django-admin2/example/blog/models.py

18 lines
335 B
Python
Raw Normal View History

2013-05-18 10:12:57 +00:00
from django.db import models
2013-05-18 10:12:57 +00:00
class Post(models.Model):
title = models.CharField(max_length=255)
body = models.TextField()
def __unicode__(self):
return self.title
2013-05-18 10:12:57 +00:00
class Comment(models.Model):
post = models.ForeignKey(Post)
body = models.TextField()
def __unicode__(self):
2013-05-19 08:09:12 +00:00
return self.body