<commit_before>from django.db import models
from django.utils.text import slugify


class Idea(models.Model):
    INCUBATION = 'IN'
    ANALYZATION = 'AN'
    EXPERIMENTATION = 'EX'
    DOCUMENTATION = 'DO'
    STAGE_CHOICES = (
        (INCUBATION, 'incubation'),
        (ANALYZATION, 'analyzation'),
        (EXPERIMENTATION, 'experimentation'),
        (DOCUMENTATION, 'documentation'),
    )

    stage = models.CharField(max_length=2, choices=STAGE_CHOICES,)
    title = models.CharField(max_length=100)
    project = models.ManyToManyField('Project', blank=True)
    published = models.BooleanField()
    last_updated = models.DateTimeField(auto_now=True, blank=True)
    featured_image = models.ImageField(upload_to="featured", blank=True)
    content = models.TextField()
    slug = models.SlugField(blank=True)

    def __unicode__(self):
        return self.title

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


class Project(models.Model):
    name = models.CharField(max_length=100)
    slug = models.SlugField(blank=True)

    def __unicode__(self):
        return self.name

    def save(self, *args, **kwargs):
        self.slug = slugify(self.name)
        super(Project, self).save(*args, **kwargs)<commit_msg>reverted the way slug saving works. slug only auto-slugs on create.<commit_after>from django.db import models
from django.utils.text import slugify


class Idea(models.Model):
    INCUBATION = 'IN'
    ANALYZATION = 'AN'
    EXPERIMENTATION = 'EX'
    DOCUMENTATION = 'DO'
    STAGE_CHOICES = (
        (INCUBATION, 'incubation'),
        (ANALYZATION, 'analyzation'),
        (EXPERIMENTATION, 'experimentation'),
        (DOCUMENTATION, 'documentation'),
    )

    stage = models.CharField(max_length=2, choices=STAGE_CHOICES,)
    title = models.CharField(max_length=100)
    project = models.ManyToManyField('Project', blank=True)
    published = models.BooleanField()
    last_updated = models.DateTimeField(auto_now=True, blank=True)
    featured_image = models.ImageField(upload_to="featured", blank=True)
    content = models.TextField()
    slug = models.SlugField(blank=True)

    def __unicode__(self):
        return self.title

    def save(self, *args, **kwargs):
        if not self.pk:
            self.slug = slugify(self.title)
        super(Idea, self).save(*args, **kwargs)


class Project(models.Model):
    name = models.CharField(max_length=100)
    slug = models.SlugField(blank=True)

    def __unicode__(self):
        return self.name

    def save(self, *args, **kwargs):
        if not self.pk:
            self.slug = slugify(self.name)
        super(Project, self).save(*args, **kwargs)
{'fraction_non_alphanumeric': 0.12509170946441672, 'fraction_numerical': 0.005135730007336757, 'mean_word_length': 3.3701923076923075, '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': '5678340', 'n_tokens_mistral': 914, 'n_tokens_neox': 866, 'n_words': 173}