Skip to content
Snippets Groups Projects
Verified Commit 3bce17c9 authored by jindra12's avatar jindra12
Browse files

Reverse date sort order

parent 29ff8137
No related branches found
No related tags found
2 merge requests!816Release,!801Prepare basic shared tags
Pipeline #14142 passed
...@@ -423,7 +423,7 @@ class MainArticlesPage( ...@@ -423,7 +423,7 @@ class MainArticlesPage(
article_list = self.append_all_shared_articles_query( article_list = self.append_all_shared_articles_query(
MainArticlePage.objects.filter(article_type=ARTICLE_TYPES.PRESS_RELEASE) MainArticlePage.objects.filter(article_type=ARTICLE_TYPES.PRESS_RELEASE)
).order_by("union_date", "union_title")[ ).order_by("-union_date", "union_title")[
:11 :11
] # dám LIMIT +1, abych věděl, jestli má cenu show_next ] # dám LIMIT +1, abych věděl, jestli má cenu show_next
ctx["article_article_list"] = self.materialize_shared_articles_query( ctx["article_article_list"] = self.materialize_shared_articles_query(
...@@ -454,7 +454,7 @@ class MainArticlesPage( ...@@ -454,7 +454,7 @@ class MainArticlesPage(
MainArticlePage.objects.filter( MainArticlePage.objects.filter(
article_type=ARTICLE_TYPES.PRESS_RELEASE article_type=ARTICLE_TYPES.PRESS_RELEASE
), ),
).order_by("union_date", "union_title"), ).order_by("-union_date", "union_title"),
10, 10,
request.GET.get("page", 1), request.GET.get("page", 1),
) )
......
...@@ -630,13 +630,13 @@ class ArticlesMixin(models.Model): ...@@ -630,13 +630,13 @@ class ArticlesMixin(models.Model):
prepared_query.union(main_by_values) prepared_query.union(main_by_values)
.union(uniweb_by_values) .union(uniweb_by_values)
.union(district_by_values) .union(district_by_values)
.order_by("union_date") .order_by("-union_date")
) )
else: else:
return ( return (
main_by_values.union(uniweb_by_values) main_by_values.union(uniweb_by_values)
.union(district_by_values) .union(district_by_values)
.order_by("union_date") .order_by("-union_date")
) )
def materialize_shared_articles_query(self, results): def materialize_shared_articles_query(self, results):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment