summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorAkshen2017-10-31 11:15:41 +0530
committerAkshen2017-10-31 16:59:51 +0530
commitae78048a1f978a6a570faeb10ecb77229460eae1 (patch)
tree34e334d5032e6e76272018f451ab41c9c7311927 /yaksh/views.py
parent840c00b9e939d2b33058d236ef4170923e0a018b (diff)
downloadonline_test-ae78048a1f978a6a570faeb10ecb77229460eae1.tar.gz
online_test-ae78048a1f978a6a570faeb10ecb77229460eae1.tar.bz2
online_test-ae78048a1f978a6a570faeb10ecb77229460eae1.zip
Fix Course Ordering in Courses Page
Latest Course will be shown on Top in Courses Page
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py6
1 files changed, 4 insertions, 2 deletions
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)