File: models.py

package info (click to toggle)
python-django-threadedcomments 0.5.3-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 804 kB
  • sloc: python: 2,521; makefile: 13
file content (19 lines) | stat: -rw-r--r-- 512 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.db import models
from datetime import datetime

class BlogPost(models.Model):
    title = models.CharField(max_length=128)
    slug = models.SlugField(prepopulate_from=('title',))
    body = models.TextField()
    published = models.BooleanField(default=True)
    date_posted = models.DateTimeField(default=datetime.now)

    def __unicode__(self):
        return self.title

    class Meta:
        verbose_name = "Blog Post"
        verbose_name_plural = "Blog Posts"

    class Admin:
        pass