from django.db import models PUB_STATUS = ( (0, 'Draft'), (1, 'Published'), ) class Code(models.Model): name = models.CharField(max_length=254) slug = models.SlugField() date_created = models.DateField('Date Created') status = models.IntegerField(choices=PUB_STATUS, default=0) body_html = models.TextField(blank=True) class Meta: verbose_name_plural = "Code" app_label = 'projects' ordering = ('-date_created',) # Returns the string representation of the model. def __unicode__(self): return self.slug