django-admin2/example/blog/models.py
2013-05-18 13:44:00 +02:00

15 lines
No EOL
332 B
Python

from django.db import models
class Post(models.Model):
title = models.CharField(max_length=255)
body = models.TextField()
def __unicode__(self):
return self.title
class Comment(models.Model):
post = models.ForeignKey(Post)
body = models.TextField()
def __unicode__(self):
return self.body