<commit_before>import uuid

from django.contrib.auth.models import User
from django.db import models
from django.db.models import Count

from afol.models import Fan
from event.models import Event, Space
from .utils import upload_path_mocs


class BaseModel(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    created = models.DateTimeField(
        verbose_name='Created', auto_now_add=True, editable=False)
    modified = models.DateTimeField(
        verbose_name='Last Modified', auto_now=True, editable=False)

    class Meta:
        abstract = True


class Category(BaseModel):
    title = models.CharField(verbose_name='Title', unique=True, max_length=64)
    description = models.TextField(verbose_name='Description')
    age_limit_min = models.IntegerField(
        verbose_name='Minimum Age Limit', default=0)
    age_limit_max = models.IntegerField(
        verbose_name='Maximum Age Limit', default=128)
    logo = models.ImageField(upload_to=upload_path_mocs, blank=True, null=True)

    def __str__(self):
        return self.title

    class Meta:
        verbose_name_plural = 'categories'


class EventCategory(BaseModel):
    category = models.ForeignKey(Category, on_delete=models.CASCADE)
    event = models.ForeignKey(Event, on_delete=models.CASCADE)

    def __str__(self):
        return self.event.title + " - " + self.category.title

    class Meta:
        verbose_name_plural = 'EventCategories'
        unique_together = ('category', 'event')


class Moc(BaseModel):
    SIDE_FRONT = 1200
    SIDE_FRONT_RIGHT = 1330
    SIDE_RIGHT = 1500
    SIDE_BACK_RIGHT = 1630
    SIDE_BACK = 1800
    SIDE_BACK_LEFT = 1930
    SIDE_LEFT = 2100
    SIDE_FRONT_LEFT = 2300
    SIDES = (
        (SIDE_FRONT, 'Front'),
        (SIDE_FRONT_RIGHT, 'Front & Right'),
        (SIDE_RIGHT, 'Right'),
        (SIDE_BACK_RIGHT, 'Back & Right'),
        (SIDE_BACK, 'Back'),
        (SIDE_BACK_LEFT, 'Back & Left'),
        (SIDE_LEFT, 'Left'),
        (SIDE_FRONT_LEFT, 'Front & Left'),
    )
    creator = models.ForeignKey(
        Fan, on_delete=models.CASCADE, default=uuid.uuid4)
    title = models.CharField(verbose_name='Title', unique=True, max_length=64)
    description = models.TextField(verbose_name='Description',
                                   help_text='<ul><li>We limit this to 300 words on the table tent.</li></ul>')
    display_requirements = models.TextField(verbose_name='Display requirements',
                                            help_text='<ul><li>Does this MOC have special display requirements like power or something more than just table space? Enter it here.</li></ul>',
                                            blank=True, null=True)
    height = models.IntegerField(verbose_name='Height', default=10,
                                 help_text="<ul><li>Enter in inches rounded up to the nearest inch.</li></ul>")
    length = models.IntegerField(verbose_name='Length', default=10,
                                 help_text="<ul><li>Enter in inches rounded up to the nearest inch.</li>"
                                           "<li>This value is important as the software will not calculate the correct table space if this value is inaccurate.</li></ul>")
    width = models.IntegerField(verbose_name='Width', default=10,
                                help_text="<ul><li>Enter in inches rounded up to the nearest inch.</li>"
                                          "<li>This value is important as the software will not calculate the correct table space if this value is inaccurate.</li></ul>")
    viewable_sides = models.IntegerField(
        verbose_name='Viewable Sides', choices=SIDES, default=SIDE_FRONT)
    url_photo = models.URLField(
        verbose_name='URL Photo', blank=True, null=True)
    url_flickr = models.URLField(
        verbose_name='URL Flicker', blank=True, null=True)
    year_built = models.DateField(verbose_name='Year Build')
    year_retired = models.DateField(
        verbose_name='Year Retired', blank=True, null=True)
    is_public = models.BooleanField(
        verbose_name='Is Public',
        help_text='Visible on Brick Fiesta Website',
        default=False)

    class Meta:
        verbose_name_plural = 'MOCs'

    def __str__(self):
        return self.title


class MocNote(BaseModel):
    moc = models.ForeignKey(Moc, on_delete=models.CASCADE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    note = models.TextField(verbose_name='Note')

    def __str__(self):
        return "{} note on {}".format(self.user, self.moc)


class MocCategories(BaseModel):
    category = models.ForeignKey(EventCategory, on_delete=models.CASCADE)
    moc = models.ForeignKey(Moc, on_delete=models.CASCADE)

    def __str__(self):
        return "{}, {}".format(self.category, self.moc.title)

<commit_msg>* Adjusting MOC Table Tents.<commit_after>import uuid

from django.contrib.auth.models import User
from django.db import models
from django.db.models import Count

from afol.models import Fan
from event.models import Event, Space
from .utils import upload_path_mocs


class BaseModel(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    created = models.DateTimeField(
        verbose_name='Created', auto_now_add=True, editable=False)
    modified = models.DateTimeField(
        verbose_name='Last Modified', auto_now=True, editable=False)

    class Meta:
        abstract = True


class Category(BaseModel):
    title = models.CharField(verbose_name='Title', unique=True, max_length=64)
    description = models.TextField(verbose_name='Description')
    age_limit_min = models.IntegerField(
        verbose_name='Minimum Age Limit', default=0)
    age_limit_max = models.IntegerField(
        verbose_name='Maximum Age Limit', default=128)
    logo = models.ImageField(upload_to=upload_path_mocs, blank=True, null=True)

    def __str__(self):
        return self.title

    class Meta:
        verbose_name_plural = 'categories'


class EventCategory(BaseModel):
    category = models.ForeignKey(Category, on_delete=models.CASCADE)
    event = models.ForeignKey(Event, on_delete=models.CASCADE)

    def __str__(self):
        return self.event.title + " - " + self.category.title

    class Meta:
        verbose_name_plural = 'EventCategories'
        unique_together = ('category', 'event')


class Moc(BaseModel):
    SIDE_FRONT = 1200
    SIDE_FRONT_RIGHT = 1330
    SIDE_RIGHT = 1500
    SIDE_BACK_RIGHT = 1630
    SIDE_BACK = 1800
    SIDE_BACK_LEFT = 1930
    SIDE_LEFT = 2100
    SIDE_FRONT_LEFT = 2300
    SIDES = (
        (SIDE_FRONT, 'Front'),
        (SIDE_FRONT_RIGHT, 'Front & Right'),
        (SIDE_RIGHT, 'Right'),
        (SIDE_BACK_RIGHT, 'Back & Right'),
        (SIDE_BACK, 'Back'),
        (SIDE_BACK_LEFT, 'Back & Left'),
        (SIDE_LEFT, 'Left'),
        (SIDE_FRONT_LEFT, 'Front & Left'),
    )
    creator = models.ForeignKey(
        Fan, on_delete=models.CASCADE, default=uuid.uuid4)
    title = models.CharField(verbose_name='Title', unique=True, max_length=64)
    description = models.TextField(verbose_name='Description',
                                   help_text='<ul><li>We limit this to 300 words on the table tent.</li></ul>')
    display_requirements = models.TextField(verbose_name='Display requirements',
                                            help_text='<ul><li>Does this MOC have special display requirements like power or something more than just table space? Enter it here.</li></ul>',
                                            blank=True, null=True)
    height = models.IntegerField(verbose_name='Height', default=10,
                                 help_text="<ul><li>Enter in inches rounded up to the nearest inch.</li></ul>")
    length = models.IntegerField(verbose_name='Length', default=10,
                                 help_text="<ul><li>Enter in inches rounded up to the nearest inch.</li>"
                                           "<li>This value is important as the software will not calculate the correct table space if this value is inaccurate.</li></ul>")
    width = models.IntegerField(verbose_name='Width', default=10,
                                help_text="<ul><li>Enter in inches rounded up to the nearest inch.</li>"
                                          "<li>This value is important as the software will not calculate the correct table space if this value is inaccurate.</li></ul>")
    viewable_sides = models.IntegerField(
        verbose_name='Viewable Sides', choices=SIDES, default=SIDE_FRONT)
    url_photo = models.URLField(
        verbose_name='URL Photo', blank=True, null=True)
    url_flickr = models.URLField(
        verbose_name='URL Flicker', blank=True, null=True)
    year_built = models.DateField(verbose_name='Year Build')
    year_retired = models.DateField(
        verbose_name='Year Retired', blank=True, null=True)
    is_public = models.BooleanField(
        verbose_name='Is Public',
        help_text='<ul><li>Visible on Brick Fiesta Website</li></ul>',
        default=False)

    class Meta:
        verbose_name_plural = 'MOCs'

    def __str__(self):
        return self.title


class MocNote(BaseModel):
    moc = models.ForeignKey(Moc, on_delete=models.CASCADE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    note = models.TextField(verbose_name='Note')

    def __str__(self):
        return "{} note on {}".format(self.user, self.moc)


class MocCategories(BaseModel):
    category = models.ForeignKey(EventCategory, on_delete=models.CASCADE)
    moc = models.ForeignKey(Moc, on_delete=models.CASCADE)

    def __str__(self):
        return "{}, {}".format(self.category, self.moc.title)


{'fraction_non_alphanumeric': 0.10738117236423365, 'fraction_numerical': 0.010471204188481676, 'mean_word_length': 2.960162601626016, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5472821', 'n_tokens_mistral': 2982, 'n_tokens_neox': 2810, 'n_words': 670}