Order galleries by start date on tag detail pages

This commit is contained in:
Alexandre Iooss 2021-10-15 09:28:37 +02:00
parent d95f29c870
commit 036cca0f59

View file

@ -23,7 +23,8 @@ class TagDetail(LoginRequiredMixin, DetailView):
current_tag = self.get_object().slug current_tag = self.get_object().slug
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
context['galleries'] = Gallery.objects.on_site().is_public() \ 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 return context