From 274548132c60b425dc1f27975d8e433ad742b680 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Fri, 7 Jul 2017 13:38:35 +0200 Subject: [PATCH] Refine publication ordering (most recent always on top) --- journals/views.py | 3 ++- scipost/views.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/journals/views.py b/journals/views.py index 899edf798..9ed655acb 100644 --- a/journals/views.py +++ b/journals/views.py @@ -73,7 +73,8 @@ def recent(request, doi_label): """ journal = get_object_or_404(Journal, doi_label=doi_label) recent_papers = Publication.objects.published( - in_issue__in_volume__in_journal=journal).order_by('-publication_date')[:20] + in_issue__in_volume__in_journal=journal).order_by('-publication_date', + '-paper_nr')[:20] context = { 'recent_papers': recent_papers, 'journal': journal, diff --git a/scipost/views.py b/scipost/views.py index 27508f14c..146b08f53 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -176,7 +176,8 @@ def index(request): context = { 'latest_newsitems': NewsItem.objects.all().order_by('-date')[:1], 'submissions': Submission.objects.public().order_by('-submission_date')[:3], - 'publications': Publication.objects.published().order_by('-publication_date')[:3] + 'publications': Publication.objects.published().order_by('-publication_date', + '-paper_nr')[:3] } return render(request, 'scipost/index.html', context) -- GitLab