<commit_before>from django.db import models

# Create your models here.<commit_msg>initial take on basic blog model<commit_after>from django.db import models


STATUS_CHOICES = (
    ('D', 'Draft'),
    ('P', 'Published'),
    ('X', 'Deleted'),
)

class Category(models.Model):
    slug = models.SlugField('category slug', unique=True, db_index=True)
    name = models.CharField('category name', max_length=50)
    create_date = models.DateTimeField('date created', auto_now_add=True)


class Tag(models.Model):
    slug = models.SlugField('tag slug', unique=True, db_index=True)
    name = models.CharField('tag name', max_length=50)
    create_date = models.DateTimeField('date created', auto_now_add=True)


class Post(models.Model):
    title = models.CharField('title of post', max_length=200)
    slug = models.SlugField('slugified title', db_index=True,
            unique_for_date="pub_date")
    content = models.TextField('post content')
    status = models.CharField(max_length=1, choices=STATUS_CHOICES)

    create_date = models.DateTimeField('date created', auto_now_add=True)
    pub_date = models.DateTimeField('date published')
    edit_date = models.DateTimeField('date edited', auto_now=True)

    categories = models.ManyToManyField(Category)
    tags = models.ManyToManyField(Tag)

    # TODO: models.ForeignKey on post author



{'fraction_non_alphanumeric': 0.1237037037037037, 'fraction_numerical': 0.005925925925925926, 'mean_word_length': 4.748936170212766, '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': '3356862', 'n_tokens_mistral': 428, 'n_tokens_neox': 412, 'n_words': 91}