Skip to content

Commit

Permalink
publications: Order by reverse primay key
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Jan 19, 2020
1 parent 3530f2c commit 1f6f24d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mpicms/publications/templatetags/publication_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
}

0 comments on commit 1f6f24d

Please sign in to comment.