mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-04-19 06:11:06 +00:00
Give example project models unicode methods
This commit is contained in:
parent
6d59986241
commit
52368d9ee1
1 changed files with 6 additions and 0 deletions
|
|
@ -4,6 +4,12 @@ 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
|
||||
Loading…
Reference in a new issue