From: Bryan Bonvallet Date: Fri, 20 Dec 2013 20:59:44 +0000 (-0500) Subject: Ordering leaderboard by score and truncating at 20 X-Git-Tag: release-20150131~376^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d6b6f922d90636b0fd7dd3bd883d83097d6d74d8;p=oweals%2Fkarmaworld.git Ordering leaderboard by score and truncating at 20 --- 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