diff --git a/main/models.py b/main/models.py index c7843c95788848cce19c4b8f000da77c6caf2487..8349b2918a755902b7300482a5c02d0c11062bbb 100644 --- a/main/models.py +++ b/main/models.py @@ -423,7 +423,7 @@ class MainArticlesPage( article_list = self.append_all_shared_articles_query( MainArticlePage.objects.filter(article_type=ARTICLE_TYPES.PRESS_RELEASE) - ).order_by("union_date", "union_title")[ + ).order_by("-union_date", "union_title")[ :11 ] # dám LIMIT +1, abych věděl, jestli má cenu show_next ctx["article_article_list"] = self.materialize_shared_articles_query( @@ -454,7 +454,7 @@ class MainArticlesPage( MainArticlePage.objects.filter( article_type=ARTICLE_TYPES.PRESS_RELEASE ), - ).order_by("union_date", "union_title"), + ).order_by("-union_date", "union_title"), 10, request.GET.get("page", 1), ) diff --git a/shared/models.py b/shared/models.py index 2e83855a6c5df4786bac5950b017b2ed36a06ab1..119fbf4af3c5a44505ecbca4bcfbf2a782085425 100644 --- a/shared/models.py +++ b/shared/models.py @@ -630,13 +630,13 @@ class ArticlesMixin(models.Model): prepared_query.union(main_by_values) .union(uniweb_by_values) .union(district_by_values) - .order_by("union_date") + .order_by("-union_date") ) else: return ( main_by_values.union(uniweb_by_values) .union(district_by_values) - .order_by("union_date") + .order_by("-union_date") ) def materialize_shared_articles_query(self, results):