<commit_before>from django.db import models
from django.utils import timezone
from django.db.models import F
from django.template.defaultfilters import slugify

# Create your models here.

class Document(models.Model):

	title = models.CharField(max_length=128)
    creator = models.ForeignKey(User)
    created_date = models.DateField(auto_now=True)
    content = models.TextField(null=True, blank=True)
    published = models.BooleanField(default=True)
    tags = models.ManyToManyField('Tag', blank=True)
    communities = models.ManyToManyField('Community', blank=True)
    slug = models.SlugField(unique=True, max_length=255)

    def save(self, *args, **kwargs):
        self.slug = slugify(self.title)
        super(Document, self).save(*args, **kwargs)

<commit_msg>models update3<commit_after>from django.db import models
from django.utils import timezone
from django.db.models import F
from django.template.defaultfilters import slugify

# Create your models here.

class Document(models.Model):

	title = models.CharField(max_length=128)
    creator = models.ForeignKey(User)
    created_date = models.DateField(auto_now=True)
    content = models.TextField(null=True, blank=True)
    language = models.CharField(max_length=8, choices=LANGUAGES,
    	default='EN')
    published = models.BooleanField(default=True)
    tags = models.ManyToManyField('Tag', blank=True)
    communities = models.ManyToManyField('Community', blank=True)
    slug = models.SlugField(unique=True, max_length=255)

    def __str__(self):
        return self.title

    def save(self, *args, **kwargs):
        self.slug = slugify(self.title)
        super(Document, self).save(*args, **kwargs)


class Community(models.Model):
    name = models.CharField(max_length=128)
    creator = models.ForeignKey(User)
    user_generated = models.BooleanField(default=False)
    description = models.TextField(null=True, blank=True)
    image = models.ImageField(upload_to='images/community_images/%Y/%m/%d/%H_%M_%S',
        null=True, blank=True, default='images/community_images/nothing.jpg')

    slug = models.SlugField(unique=True, max_length=255)

    def __str__(self):
        return self.name

    def save(self, *args, **kwargs):
        self.slug = slugify(self.name)
        super(Community, self).save(*args, **kwargs)


class Tag(models.Model):
    name = models.CharField(max_length=128)
    creator = models.ForeignKey(User)
    user_generated = models.BooleanField(default=False)
    community = models.ManyToManyField(Community)
    description = models.TextField(null=True, blank=True)
    image = models.ImageField(upload_to='images/tag_images/%Y/%m/%d/%H_%M_%S',
        null=True, blank=True, default='images/tag_images/nothing.jpg')

    slug = models.SlugField(unique=True, max_length=255)

    def __str__(self):
        return self.name

    def save(self, *args, **kwargs):
        self.slug = slugify(self.name)
        super(Tag, self).save(*args, **kwargs)
{'fraction_non_alphanumeric': 0.12445193929173694, 'fraction_numerical': 0.008768971332209106, 'mean_word_length': 4.268206039076377, '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': '5731624', 'n_tokens_mistral': 952, 'n_tokens_neox': 917, 'n_words': 177}