From 036cca0f596c920f8d2f09adb9890bfccae68163 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 15 Oct 2021 09:28:37 +0200 Subject: [PATCH] Order galleries by start date on tag detail pages --- photologue_custom/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/photologue_custom/views.py b/photologue_custom/views.py index 49301ff..33b2426 100644 --- a/photologue_custom/views.py +++ b/photologue_custom/views.py @@ -23,7 +23,8 @@ class TagDetail(LoginRequiredMixin, DetailView): current_tag = self.get_object().slug context = super().get_context_data(**kwargs) context['galleries'] = Gallery.objects.on_site().is_public() \ - .filter(extended__tags__slug=current_tag) + .filter(extended__tags__slug=current_tag) \ + .order_by('-extended__date_start') return context