diff --git a/district/models.py b/district/models.py index dc1e8aaa11b2f7695568c76be4e0422e4a64c9de..2adb5672456723651f9cf3a39182efd2c4a4bd10 100644 --- a/district/models.py +++ b/district/models.py @@ -193,7 +193,7 @@ class DistrictHomePage(MetadataPageMixin, CalendarMixin, Page): .type(DistrictArticlePage) .live() .specific() - .order_by("-last_published_at")[:6] + .order_by("-districtarticlepage__date")[:6] ) @property @@ -276,7 +276,7 @@ class DistrictArticlePage(ArticleMixin, SubpageMixin, MetadataPageMixin, Page): self.get_siblings(inclusive=False) .live() # TODO? filtrovat na stejné tagy? .specific() - .order_by("-last_published_at")[:3] + .order_by("-districtarticlepage__date")[:3] ) return context @@ -307,7 +307,10 @@ class DistrictArticlesPage(SubpageMixin, MetadataPageMixin, Page): def get_context(self, request): context = super().get_context(request) context["articles"] = Paginator( - self.get_children().live().specific().order_by("-last_published_at"), + self.get_children() + .live() + .specific() + .order_by("-districtarticlepage__date"), self.max_items, ).get_page(request.GET.get("page")) return context @@ -393,7 +396,7 @@ class DistrictTagsPage(SubpageMixin, MetadataPageMixin, Page): return { "article_page_list": Paginator( - article_page_qs.order_by("-last_published_at"), + article_page_qs.order_by("-date"), self.root_page.articles_page.max_items, ).get_page(request.GET.get("page")), "tag": tag, diff --git a/region/models.py b/region/models.py index d9f9c544a0072721eafc007932097a6b20abcb7c..decef6fb873c368c083bd7d8bf1e4cc33e4ee23e 100644 --- a/region/models.py +++ b/region/models.py @@ -193,7 +193,7 @@ class RegionHomePage(MetadataPageMixin, CalendarMixin, Page): .type(RegionArticlePage) .live() .specific() - .order_by("-last_published_at")[:6] + .order_by("-regionarticlepage__date")[:6] ) @property @@ -274,7 +274,7 @@ class RegionArticlePage(ArticleMixin, SubpageMixin, MetadataPageMixin, Page): self.get_siblings(inclusive=False) .live() .specific() - .order_by("-last_published_at")[:3] + .order_by("-regionarticlepage__date")[:3] ) return context @@ -305,7 +305,7 @@ class RegionArticlesPage(SubpageMixin, MetadataPageMixin, Page): def get_context(self, request): context = super().get_context(request) context["articles"] = Paginator( - self.get_children().live().specific().order_by("-last_published_at"), + self.get_children().live().specific().order_by("-regionarticlepage__date"), self.max_items, ).get_page(request.GET.get("page")) return context @@ -391,7 +391,7 @@ class RegionTagsPage(SubpageMixin, MetadataPageMixin, Page): return { "article_page_list": Paginator( - article_page_qs.order_by("-last_published_at"), + article_page_qs.order_by("-date"), self.root_page.articles_page.max_items, ).get_page(request.GET.get("page")), "tag": tag,