From 1f6f24dd0be5c3c000aa52df3b7f90248e48d582 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 19 Jan 2020 19:34:10 +0100 Subject: [PATCH] publications: Order by reverse primay key Change order of publications show with the publication_list tag, which is used to show 5 publications on the root page. Order by reverse primary key to show last five entries. --- mpicms/publications/templatetags/publication_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpicms/publications/templatetags/publication_tags.py b/mpicms/publications/templatetags/publication_tags.py index 03091d4..88d1eef 100644 --- a/mpicms/publications/templatetags/publication_tags.py +++ b/mpicms/publications/templatetags/publication_tags.py @@ -7,6 +7,6 @@ @register.inclusion_tag('publications/components/list.html', takes_context=True) def publication_list(context): return { - 'publications': Publication.objects.all()[:5], + 'publications': Publication.objects.order_by('-pk')[:5], 'request': context['request'], }