summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorThayer Williams <thayerw@gmail.com>2010-03-16 11:19:58 -0700
committerDan McGee <dan@archlinux.org>2010-05-17 14:49:43 -0500
commit958bc6311392849d0bcbfe834dd95f2e49817ce8 (patch)
tree97d2d1aa4f5c5afb4938f7b29d0aff865f6f7c17 /main/models.py
parentdd9f1e3e91db5ede16900fc9257f921b37538410 (diff)
Add alphabetical sorting to mirrorlists
Also unify the sorting at the model-level for donors and remove the now duplicate sorting in the admin for mirrors. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 1f938cc5..8dc05a53 100644
--- a/main/models.py
+++ b/main/models.py
@@ -72,6 +72,10 @@ class Mirror(models.Model):
rsync_user = models.CharField(max_length=50, blank=True, default='')
rsync_password = models.CharField(max_length=50, blank=True, default='')
notes = models.TextField(blank=True)
+
+ class Meta:
+ ordering = ('country', 'name')
+
def __unicode__(self):
return self.name
@@ -106,10 +110,13 @@ class MirrorRsync(models.Model):
class Donor(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255, unique=True)
+
def __unicode__(self):
return self.name
+
class Meta:
db_table = 'donors'
+ ordering = ['name']
class News(models.Model):
id = models.AutoField(primary_key=True)