gergelypolonkai-web-django/blog/models.py

16 lines
462 B
Python
Raw Normal View History

2013-09-24 13:54:41 +00:00
from django.db import models
from django.contrib.auth.models import User
2013-10-01 19:18:11 +00:00
from taggit.managers import TaggableManager
2013-09-24 13:54:41 +00:00
class Post(models.Model):
user = models.ForeignKey(User)
created_at = models.DateTimeField()
title = models.CharField(max_length = 100)
slug = models.CharField(max_length = 100)
content = models.TextField()
draft = models.BooleanField()
2013-10-01 19:18:11 +00:00
tags = TaggableManager()
2013-09-24 13:54:41 +00:00
def __unicode__(self):
return self.title