<commit_before>from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MaxLengthValidator, MinLengthValidator

from uuslug import uuslug


class Event(models.Model):
    """Event model."""
    name = models.CharField(max_length=400)
    slug = models.SlugField(max_length=400)

    def save(self, *args, **kwargs):
        if not self.pk:
            self.slug = uuslug(self.name, instance=self)
        super(Event, self).save(*args, **kwargs)


class MozillianProfile(models.Model):
    """Mozillians User Profile"""
    user = models.OneToOneField(User, related_name='userprofile')
    slug = models.SlugField(blank=True, max_length=100)
    full_name = models.CharField(max_length=255)
    city = models.CharField(max_length=50, default='', blank=True)
    country = models.CharField(max_length=50, default='')
    ircname = models.CharField(max_length=50, default='')
    avatar_url = models.URLField(max_length=400, default='')
    bio = models.TextField(default='', blank=True)

    def __unicode__(self):
        return self.full_name

    class Meta:
        ordering = ['full_name']

    def save(self, *args, **kwargs):
        if not self.pk:
            self.slug = uuslug(self.full_name, instance=self)
        super(MozillianProfile, self).save(*args, **kwargs)


class Question(models.Model):
    """Question relational model."""
    asked_by = models.ForeignKey(User)
    event = models.ForeignKey(Event, related_name='questions')
    question = models.TextField(validators=[MaxLengthValidator(1000),
                                            MinLengthValidator(20)])

    @property
    def get_vote_count(self):
        return self.vote_set.all().count()


class Vote(models.Model):
    """Vote model."""
    user = models.ForeignKey(User)
    question = models.ForeignKey(Question)
    date_voted = models.DateField(auto_now_add=True)
<commit_msg>Change min and max question length validator<commit_after>from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MaxLengthValidator, MinLengthValidator

from uuslug import uuslug


class Event(models.Model):
    """Event model."""
    name = models.CharField(max_length=400)
    slug = models.SlugField(max_length=400)

    def save(self, *args, **kwargs):
        if not self.pk:
            self.slug = uuslug(self.name, instance=self)
        super(Event, self).save(*args, **kwargs)


class MozillianProfile(models.Model):
    """Mozillians User Profile"""
    user = models.OneToOneField(User, related_name='userprofile')
    slug = models.SlugField(blank=True, max_length=100)
    full_name = models.CharField(max_length=255)
    city = models.CharField(max_length=50, default='', blank=True)
    country = models.CharField(max_length=50, default='')
    ircname = models.CharField(max_length=50, default='')
    avatar_url = models.URLField(max_length=400, default='')
    bio = models.TextField(default='', blank=True)

    def __unicode__(self):
        return self.full_name

    class Meta:
        ordering = ['full_name']

    def save(self, *args, **kwargs):
        if not self.pk:
            self.slug = uuslug(self.full_name, instance=self)
        super(MozillianProfile, self).save(*args, **kwargs)


class Question(models.Model):
    """Question relational model."""
    asked_by = models.ForeignKey(User)
    event = models.ForeignKey(Event, related_name='questions')
    question = models.TextField(validators=[MaxLengthValidator(140),
                                            MinLengthValidator(10)])

    @property
    def get_vote_count(self):
        return self.vote_set.all().count()


class Vote(models.Model):
    """Vote model."""
    user = models.ForeignKey(User)
    question = models.ForeignKey(Question)
    date_voted = models.DateField(auto_now_add=True)

{'fraction_non_alphanumeric': 0.12506459948320414, 'fraction_numerical': 0.013695090439276485, 'mean_word_length': 3.5919335705812574, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '898002', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1167, 'n_words': 238}