From ae78048a1f978a6a570faeb10ecb77229460eae1 Mon Sep 17 00:00:00 2001 From: Akshen Date: Tue, 31 Oct 2017 11:15:41 +0530 Subject: Fix Course Ordering in Courses Page Latest Course will be shown on Top in Courses Page --- yaksh/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'yaksh') diff --git a/yaksh/views.py b/yaksh/views.py index b4cb844..47d8c9f 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -792,8 +792,10 @@ def courses(request): ci = RequestContext(request) if not is_moderator(user): raise Http404('You are not allowed to view this page') - courses = Course.objects.filter(creator=user, is_trial=False) - allotted_courses = Course.objects.filter(teachers=user, is_trial=False) + courses = Course.objects.filter( + creator=user, is_trial=False).order_by('-id') + allotted_courses = Course.objects.filter( + teachers=user, is_trial=False).order_by('-id') context = {'courses': courses, "allotted_courses": allotted_courses} return my_render_to_response('yaksh/courses.html', context, context_instance=ci) -- cgit