diff options
author | Dan McGee <dan@archlinux.org> | 2010-11-27 21:43:01 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-11-27 21:43:01 +0100 |
commit | 21c48f9fbcdc6c42d664a09bda85285cbc7d72ec (patch) | |
tree | 64e7c0b04f310cbf77a3845e2ff01361fd79d12b /main | |
parent | a52a46cee2befbf23513c2289f00bcca7115cde4 (diff) | |
download | archweb-21c48f9fbcdc6c42d664a09bda85285cbc7d72ec.tar.gz archweb-21c48f9fbcdc6c42d664a09bda85285cbc7d72ec.tar.xz |
Add less-than methods for Repo and Arch
These are the methods guaranteed to be used by the python sort
functions; define them so we can simplify sorting code elsewhere as
needed.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r-- | main/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py index 6fdb862..51cf89a 100644 --- a/main/models.py +++ b/main/models.py @@ -67,6 +67,9 @@ class Arch(models.Model): def __unicode__(self): return self.name + def __lt__(self, other): + return self.name < other.name + class Meta: db_table = 'arches' ordering = ['name'] @@ -85,6 +88,9 @@ class Repo(models.Model): def __unicode__(self): return self.name + def __lt__(self, other): + return self.name < other.name + class Meta: db_table = 'repos' ordering = ['name'] |