django-admin2/example/blog/models.py
Daniel Greenfeld 28b6a0f72a pep8 of code
2013-05-19 10:09:12 +02:00

17 lines
335 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