From eacd3816f594db873f78fa479ba34dcd12b008d6 Mon Sep 17 00:00:00 2001 From: Konstantin Kostov Date: Tue, 9 Apr 2024 09:40:18 +0200 Subject: [PATCH] fix sort order for posts via tag, version 33 --- Makefile | 2 +- blog/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 02e6c34..370bfe4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: help build publish -VERSION = 1.0.32 +VERSION = 1.0.33 help: @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/blog/models.py b/blog/models.py index 2f0c893..34dedbc 100644 --- a/blog/models.py +++ b/blog/models.py @@ -35,7 +35,7 @@ class BlogTagIndexPage(Page): def get_context(self, request): tag = request.GET.get('tag') - blogpages = BlogPage.objects.filter(tags__name=tag) + blogpages = BlogPage.objects.live().filter(tags__name=tag).order_by('-first_published_at') # Update template context context = super().get_context(request)