From 21c48f9fbcdc6c42d664a09bda85285cbc7d72ec Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 27 Nov 2010 14:43:01 -0600 Subject: 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 --- main/models.py | 6 ++++++ 1 file changed, 6 insertions(+) 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'] -- cgit v1.2.3-24-g4f1b