<commit_before>import datetime, markdown
from django.contrib.comments.views import comments
from django_yaba.blog.comments import wrapped_post_comment
from markdown import markdown
from django.db.models import permalink
from django_yaba.blog.fields import ThumbnailImageField
from django.contrib.auth.models import User
from django.db import models

VIEWABLE_STATUS = [3, 4]

class ViewableManager(models.Manager):
    def get_query_set(self):
        default_queryset = super(ViewableManager, self).get_query_set()
        return default_queryset.filter(status__in=VIEWABLE_STATUS)

class Category(models.Model):
    """ Categories for the Content that is Submitted """
    label = models.CharField(blank=True, max_length=50)
    slug = models.SlugField()

    class Meta:
        verbose_name_plural = "categories"

    def __unicode__(self):
        return self.label
  
    @permalink
    def get_absolute_url(self):
        return ("blog-category", (), {'slug' : self.slug})

class Links(models.Model):
    """ A model for links to other sites """
    label = models.CharField(max_length=100)
    site_link = models.CharField(max_length=300)
    slug = models.SlugField()

    class Meta:
        ordering = ['label']
        verbose_name_plural = "links"

    def __unicode__(self):
        return self.label


class Story(models.Model):
    """ If this model name isn't self explanatory, quit life """

    STATUS_CHOICES = (
        (1, "Needs Edit"),
        (2, "Needs Approval"),
        (3, "Published"),
        (4, "Archived"),
    )

    title = models.CharField(blank=True, max_length=50)
    slug = models.SlugField()
    category = models.ManyToManyField(Category)
    markdown_content = models.TextField()
    html_content = models.TextField(editable=False)
    owner = models.ForeignKey(User)
    status = models.IntegerField(choices=STATUS_CHOICES, default=1)
    created = models.DateTimeField(default=datetime.datetime.now)
    modified = models.DateTimeField(default=datetime.datetime.now)

    class Meta:
        ordering = ['-modified']
        verbose_name_plural = "stories"

    def __unicode__(self):
        return self.title

    @permalink
    def get_absolute_url(self):
        return ("blog-story", (), {'slug' : self.slug})

    admin_objects = models.Manager()
    objects = ViewableManager()

class Article(models.Model):
    """ Articles are a bit different from Stories. These are 'extra' content pieces. For instance items that don't belong as news, maybe like a projects page of sorts. 
        By setting 'buttoned' to true in the admin panel, the buttons on the top nav bar will link to this page, and the text will be the title of this page
    """

    STATUS_CHOICES = (
        (1, "Needs Edit"),
        (2, "Needs Approval"),
        (3, "Published"),
        (4, "Archived"),
    )

    title = models.CharField(blank=True, max_length=50)
    slug = models.SlugField()
    category = models.ForeignKey(Category)
    markdown_content = models.TextField()
    html_content = models.TextField(editable=False)<commit_msg>cleaned up the models a bit..<commit_after>import datetime, markdown
from django.contrib.comments.views import comments
from django_yaba.blog.comments import wrapped_post_comment
from markdown import markdown
from django.db.models import permalink
from django_yaba.blog.fields import ThumbnailImageField
from django.contrib.auth.models import User
from django.db import models

VIEWABLE_STATUS = [3, 4]

class ViewableManager(models.Manager):
    def get_query_set(self):
        default_queryset = super(ViewableManager, self).get_query_set()
        return default_queryset.filter(status__in=VIEWABLE_STATUS)

class Category(models.Model):
    """ Categories for the Content that is Submitted """
    label = models.CharField(blank=True, max_length=50)
    slug = models.SlugField()

    class Meta:
        verbose_name_plural = "categories"

    def __unicode__(self):
        return self.label
  
    @permalink
    def get_absolute_url(self):
        return ("blog-category", (), {'slug' : self.slug})

class Links(models.Model):
    """ A model for links to other sites """
    label = models.CharField(max_length=100)
    site_link = models.CharField(max_length=300)
    slug = models.SlugField()

    class Meta:
        ordering = ['label']
        verbose_name_plural = "links"

    def __unicode__(self):
        return self.label


class Story(models.Model):
    """ If this model name isn't self explanatory, quit life """

    STATUS_CHOICES = (
        (1, "Needs Edit"),
        (2, "Needs Approval"),
        (3, "Published"),
        (4, "Archived"),
    )

    title = models.CharField(blank=True, max_length=50)
    slug = models.SlugField()
    category = models.ManyToManyField(Category)
    markdown_content = models.TextField()
    owner = models.ForeignKey(User)
    status = models.IntegerField(choices=STATUS_CHOICES, default=1)
    created = models.DateTimeField(default=datetime.datetime.now)
    modified = models.DateTimeField(default=datetime.datetime.now)

    class Meta:
        ordering = ['-modified']
        verbose_name_plural = "stories"

    def __unicode__(self):
        return self.title

    @permalink
    def get_absolute_url(self):
        return ("blog-story", (), {'slug' : self.slug})

    admin_objects = models.Manager()
    objects = ViewableManager()

class Article(models.Model):
    """ Articles are a bit different from Stories. These are 'extra' content pieces. For instance items that don't belong as news, maybe like a projects page of sorts. 
        By setting 'buttoned' to true in the admin panel, the buttons on the top nav bar will link to this page, and the text will be the title of this page
    """

    STATUS_CHOICES = (
        (1, "Needs Edit"),
        (2, "Needs Approval"),
        (3, "Published"),
        (4, "Archived"),
    )

    title = models.CharField(blank=True, max_length=50)
    slug = models.SlugField()
    category = models.ManyToManyField(Category)
    markdown_content = models.TextField()
{'fraction_non_alphanumeric': 0.10566286940729734, 'fraction_numerical': 0.007594518738649496, 'mean_word_length': 3.370851370851371, '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': '453065', 'n_tokens_mistral': 1842, 'n_tokens_neox': 1758, 'n_words': 484}