From a2f537a5accb30a0ce518facfb689b56b90719be Mon Sep 17 00:00:00 2001 From: Ruslan Stepanov Date: Fri, 24 Jan 2020 11:59:13 +0000 Subject: [PATCH] Update content-pages --- apps/main/views/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/main/views/common.py b/apps/main/views/common.py index 03a0ad72..3a77055a 100644 --- a/apps/main/views/common.py +++ b/apps/main/views/common.py @@ -107,7 +107,10 @@ class ContentPageBaseView(generics.GenericAPIView): return 'static' def get_queryset(self): - return super().get_queryset().filter(news_type__name=self.static_page_category) + return News.objects.with_base_related() \ + .order_by('-is_highlighted', '-publication_date', '-publication_time') \ + .filter(news_type__name=self.static_page_category) + class ContentPageView(ContentPageBaseView, generics.ListAPIView):