From cf9e94b37906ef1a600fb1a843b00349cede14f6 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 19 Feb 2014 16:12:08 +0530 Subject: correcting the query to fetch the six latest books --- tbc/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbc/views.py b/tbc/views.py index bc35c18..bf36eb4 100644 --- a/tbc/views.py +++ b/tbc/views.py @@ -80,7 +80,7 @@ def Home(request): context['update_book'] = True if 'not_found' in request.GET: context['not_found'] = True - books = Book.objects.filter(approved=True)[0:6] + books = Book.objects.filter(approved=True).order_by("-id")[0:6] for book in books: images.append(ScreenShots.objects.filter(book=book)[0]) context['images'] = images -- cgit