blob: 14a66f0568523397276a3288fc8f851fc17a05a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
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
|