From cb5c75d0a53dbd57dcab6d77137ac8e8c4add744 Mon Sep 17 00:00:00 2001 From: Harpo Date: Mon, 8 Jul 2024 10:29:37 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=94=20Page=20order=20(#189)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Orders pages by most recently published for Exhibits and Collections Closes #173 --- exhibits/views.py | 3 +++ ov_collections/views.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/exhibits/views.py b/exhibits/views.py index 8a4c805..2f0acb8 100644 --- a/exhibits/views.py +++ b/exhibits/views.py @@ -17,3 +17,6 @@ class ExhibitsAPIViewSet(PagesAPIViewSet): 'hero_thumb', 'authors', ] + + def get_queryset(self): + return self.model.objects.live().order_by("-last_published_at") diff --git a/ov_collections/views.py b/ov_collections/views.py index 0e2f040..93ad61d 100644 --- a/ov_collections/views.py +++ b/ov_collections/views.py @@ -14,3 +14,6 @@ class CollectionAPIViewSet(PagesAPIViewSet): 'introduction', 'cover_image', ] + + def get_queryset(self): + return self.model.objects.live().order_by("-last_published_at")