I have a web site running Wagtail CMS 2.6.1. Users have created an "Updates" page and a number of news/updates articles under it. The problem is on the "Updates" page the children are shown in alphabetical order, instead of reverse chronological order.
Can this be changed somehow from the admin interface? If not, what is the fastest way to do it in Python?
This is the the Python model (I believe):
class ArticleIndexPage(Page):
intro = models.CharField(max_length=250, blank=True, null=True)
content_panels = Page.content_panels + [
FieldPanel('intro', classname='full')
]
def get_context(self, request, *args, **kwargs):
context = super(ArticleIndexPage, self)\
.get_context(request, *args, **kwargs)
children = ArticlePage.objects.live()\
.child_of(self).not_type(ArticleIndexPage).order_by('-date')
siblings = ArticleIndexPage.objects.live()\
.sibling_of(self).order_by('title')
child_groups = ArticleIndexPage.objects.live()\
.child_of(self).type(ArticleIndexPage).order_by('title')
child_groups_for_layout = convert_list_to_matrix(child_groups)
context['children'] = children
context['siblings'] = siblings
context['child_groups'] = child_groups_for_layout
return context
UpdatesPageand the template that is rendering this page. - Dan Swain