Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Entry(models.Model):
- STATUS_CHOICES = (
- (1, 'Draft'),
- (2, 'Public'),
- (3, 'Private'))
- author = models.ForeignKey(User)
- comments_enabled = models.BooleanField(default=True)
- slug = models.SlugField(prepopulate_from=('title',),
- unique_for_date='pub_date')
- title = models.CharField(max_length=250)
- body = models.TextField()
- excerpt = models.TextField()
- status = models.IntegerField(choices=STATUS_CHOICES, default=2)
- categories = models.ManyToManyField(Category)
- pub_date = models.DateTimeField('Date posted', default=datetime.datetime.today)
- update_date = models.DateTimeField()
- #tags
- class Meta:
- get_latest_by = 'pub_date'
- ordering = ['-pub_date']
- class Admin:
- pass
- def unicode(self):
- return self.title
Add Comment
Please, Sign In to add comment