Order talks by date

This commit is contained in:
Jake Howard 2024-07-11 11:35:55 +01:00
parent 1822f1c4d5
commit 009b4926a4
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 9 additions and 1 deletions

View file

@ -12,6 +12,14 @@ class TalksListPage(BaseListingPage):
max_count = 1
subpage_types = ["talks.TalkPage"]
def get_listing_pages(self) -> models.QuerySet:
return (
TalkPage.objects.live()
.public()
.descendant_of(self)
.order_by("-date", "title")
)
class TalkPage(BaseContentPage):
subpage_types: list[Any] = []

View file

@ -37,7 +37,7 @@ class TalksListPageTestCase(TestCase):
self.assertEqual(len(response.context["listing_pages"]), 2)
def test_queries(self) -> None:
with self.assertNumQueries(35):
with self.assertNumQueries(34):
self.client.get(self.page.url)
def test_feed_accessible(self) -> None: