From 7b573dfcd2e1e36f1e124d7fd2c63e444a9d648f Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Fri, 25 Jan 2013 16:51:59 -0500 Subject: [PATCH] set default sort order for schools (file_count descending) --- karmaworld/apps/courses/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/karmaworld/apps/courses/models.py b/karmaworld/apps/courses/models.py index 8ac6b1b..000394a 100644 --- a/karmaworld/apps/courses/models.py +++ b/karmaworld/apps/courses/models.py @@ -23,6 +23,10 @@ class School(models.Model): facebook_id = models.BigIntegerField(blank=True, null=True) file_count = models.IntegerField(default=0) + class Meta: + """ Sort School by file_count descending, name abc=> """ + ordering = ['-file_count', 'name'] + def __unicode__(self): return self.name -- 2.25.1