X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/b827036bf51a88f141976bb74459da7d1f7d8ba5..e3037e2cf8a7ad3d0c3dba94083d1753301f581b:/contrib/penfield/models.py?ds=inline diff --git a/contrib/penfield/models.py b/contrib/penfield/models.py index c4cb49e..2a10e26 100644 --- a/contrib/penfield/models.py +++ b/contrib/penfield/models.py @@ -230,6 +230,7 @@ class NewsletterArticle(Entity, Titled): full_text = models.TextField() class Meta: + get_latest_by = 'date' ordering = ['-date'] unique_together = (('newsletter', 'slug'),) @@ -240,7 +241,7 @@ register_value_model(NewsletterArticle) class NewsletterIssue(Entity, Titled): newsletter = models.ForeignKey(Newsletter, related_name='issues') number = models.PositiveIntegerField() - articles = models.ManyToManyField(NewsletterArticle) + articles = models.ManyToManyField(NewsletterArticle, related_name='issues') class Meta: ordering = ['-number']