| 66 | |
| 67 | |
| 68 | class Article(models.Model): |
| 69 | author = models.ForeignKey(Author, models.CASCADE) |
| 70 | headline = models.CharField(max_length=50) |
| 71 | pub_date = models.DateTimeField() |
| 72 | categories = models.ManyToManyField(Category) |
| 73 | meta_data = models.ManyToManyField(CategoryMetaData) |
| 74 | topics = models.ManyToManyField(Topic) |
| 75 | |
| 76 | class Meta: |
| 77 | ordering = ("pub_date",) |
| 78 | |
| 79 | def __str__(self): |
| 80 | return self.headline |
| 81 | |
| 82 | |
| 83 | class AuthorProfile(models.Model): |