From d6b6f922d90636b0fd7dd3bd883d83097d6d74d8 Mon Sep 17 00:00:00 2001 From: Bryan Bonvallet Date: Fri, 20 Dec 2013 15:59:44 -0500 Subject: [PATCH] Ordering leaderboard by score and truncating at 20 --- karmaworld/apps/courses/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karmaworld/apps/courses/views.py b/karmaworld/apps/courses/views.py index 8f8d84e..1bd64ee 100644 --- a/karmaworld/apps/courses/views.py +++ b/karmaworld/apps/courses/views.py @@ -83,7 +83,7 @@ class AboutView(TemplateView): def get_context_data(self, **kwargs): """ get the list of schools with the most files for leaderboard """ context = { 'params': kwargs, - 'schools': School.objects.filter(file_count__gt=0).order_by('name') } + 'schools': School.objects.filter(file_count__gt=0).order_by('file_count')[:20] } return context -- 2.25.1