<commit_before>from django.db import models

from share.models.base import ShareObject
from share.models.fields import ShareForeignKey, URIField
from share.apps import ShareConfig as share_config


__all__ = ('Venue', 'Award', 'Tag', 'Link')

# TODO Rename this file


class Venue(ShareObject):
    name = models.CharField(max_length=255)
    venue_type = models.URLField(blank=True)
    location = models.URLField(blank=True)
    community_identifier = models.URLField(blank=True)

    def __str__(self):
        return self.name


class Award(ShareObject):
    # ScholarlyArticle has an award object
    # it's just a text field, I assume our 'description' covers it.
    award = models.URLField(blank=True)
    description = models.TextField(blank=True)
    url = models.URLField(blank=True)

    def __str__(self):
        return self.description


class Tag(ShareObject):
    name = models.CharField(max_length=255)
    url = models.URLField(blank=True)

    def __str__(self):
        return self.name


class Link(ShareObject):
    url = URIField()
    type = models.CharField(max_length=50, choices=share_config.link_type_choices)
    work = ShareForeignKey('AbstractCreativeWork')

    def __str__(self):
        return self.url


# Through Tables for all the things

class ThroughLinks(ShareObject):
    link = ShareForeignKey(Link)
    creative_work = ShareForeignKey('AbstractCreativeWork')


class ThroughVenues(ShareObject):
    venue = ShareForeignKey(Venue)
    creative_work = ShareForeignKey('AbstractCreativeWork')


class ThroughAwards(ShareObject):
    award = ShareForeignKey(Award)
    creative_work = ShareForeignKey('AbstractCreativeWork')


class ThroughTags(ShareObject):
    tag = ShareForeignKey(Tag)
    creative_work = ShareForeignKey('AbstractCreativeWork')<commit_msg>Remove unrequired foreignkey<commit_after>from django.db import models

from share.models.base import ShareObject
from share.models.fields import ShareForeignKey, URIField
from share.apps import ShareConfig as share_config


__all__ = ('Venue', 'Award', 'Tag', 'Link')

# TODO Rename this file


class Venue(ShareObject):
    name = models.CharField(max_length=255)
    venue_type = models.URLField(blank=True)
    location = models.URLField(blank=True)
    community_identifier = models.URLField(blank=True)

    def __str__(self):
        return self.name


class Award(ShareObject):
    # ScholarlyArticle has an award object
    # it's just a text field, I assume our 'description' covers it.
    award = models.URLField(blank=True)
    description = models.TextField(blank=True)
    url = models.URLField(blank=True)

    def __str__(self):
        return self.description


class Tag(ShareObject):
    name = models.CharField(max_length=255)
    url = models.URLField(blank=True)

    def __str__(self):
        return self.name


class Link(ShareObject):
    url = URIField()
    type = models.CharField(max_length=50, choices=share_config.link_type_choices)

    def __str__(self):
        return self.url


# Through Tables for all the things

class ThroughLinks(ShareObject):
    link = ShareForeignKey(Link)
    creative_work = ShareForeignKey('AbstractCreativeWork')


class ThroughVenues(ShareObject):
    venue = ShareForeignKey(Venue)
    creative_work = ShareForeignKey('AbstractCreativeWork')


class ThroughAwards(ShareObject):
    award = ShareForeignKey(Award)
    creative_work = ShareForeignKey('AbstractCreativeWork')


class ThroughTags(ShareObject):
    tag = ShareForeignKey(Tag)
    creative_work = ShareForeignKey('AbstractCreativeWork')
{'fraction_non_alphanumeric': 0.09169938306225463, 'fraction_numerical': 0.00448681996634885, 'mean_word_length': 4.4375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6303585', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1043, 'n_words': 245}