set default sort order for schools (file_count descending)
authorSeth Woodworth <seth@sethish.com>
Fri, 25 Jan 2013 21:51:59 +0000 (16:51 -0500)
committerSeth Woodworth <seth@sethish.com>
Fri, 25 Jan 2013 21:51:59 +0000 (16:51 -0500)
karmaworld/apps/courses/models.py

index 8ac6b1be94c1b6fdd68e4a6099c73cd0b4b25326..000394ae2b3e5d47fec86e9c8e7e9f11d156d163 100644 (file)
@@ -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