mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
@@ -14,6 +14,7 @@ class Article(models.Model):
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Comment(models.Model):
|
||||
article = models.ForeignKey(Article, related_name="comments")
|
||||
@@ -24,5 +25,6 @@ class Comment(models.Model):
|
||||
def __str__(self):
|
||||
return 'Comment to %s (%s)' % (self.article.title, self.pub_date)
|
||||
|
||||
|
||||
class Category(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
Reference in New Issue
Block a user