From 3fbc3f2596de050e74a16a569f99f27e6801c8a4 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Tue, 11 Oct 2016 11:53:26 +0100 Subject: [PATCH] Reverse date order of post list (oldest at top) --- blog/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/views.py b/blog/views.py index 38ae51e..33e9301 100644 --- a/blog/views.py +++ b/blog/views.py @@ -4,7 +4,7 @@ from .models import Post from .forms import PostForm def post_list(request): - posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date') + posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('-published_date') return render(request, 'blog/post_list.html', {'posts': posts}) def post_detail(request, pk): -- 2.34.1