Order talks by date
This commit is contained in:
parent
1822f1c4d5
commit
009b4926a4
2 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,14 @@ class TalksListPage(BaseListingPage):
|
||||||
max_count = 1
|
max_count = 1
|
||||||
subpage_types = ["talks.TalkPage"]
|
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):
|
class TalkPage(BaseContentPage):
|
||||||
subpage_types: list[Any] = []
|
subpage_types: list[Any] = []
|
||||||
|
|
|
@ -37,7 +37,7 @@ class TalksListPageTestCase(TestCase):
|
||||||
self.assertEqual(len(response.context["listing_pages"]), 2)
|
self.assertEqual(len(response.context["listing_pages"]), 2)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(35):
|
with self.assertNumQueries(34):
|
||||||
self.client.get(self.page.url)
|
self.client.get(self.page.url)
|
||||||
|
|
||||||
def test_feed_accessible(self) -> None:
|
def test_feed_accessible(self) -> None:
|
||||||
|
|
Loading…
Reference in a new issue