diff --git a/jack/models.py b/jack/models.py index e6f079e..dfee28f 100644 --- a/jack/models.py +++ b/jack/models.py @@ -72,11 +72,27 @@ class Article: class PublishedUnpublished: @property def published_articles(self): - return [x for x in self.articles if x.published_date] + results = [x for x in self.articles if x.published_date] + + sorted( + results, + key=lambda x: x.pubished_date, + reverse=True, + ) + + return results @property def articles_without_date(self): - return [x for x in self.articles if not x.published_date] + results = [x for x in self.articles if not x.published_date] + + sorted( + results, + key=lambda x: x.pubished_date, + reverse=True, + ) + + return results class Section(PublishedUnpublished): diff --git a/templates/index.html b/templates/index.html index 30987f2..8d534a4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,7 +7,7 @@