summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2008-04-17 05:45:49 +0200
committereliott <eliott@cactuswax.net>2008-04-17 05:45:49 +0200
commit7d4b89f3dea9635be081fd053d2ce5d293655702 (patch)
treee122baeef809702dc2c1af6ec25da6dcda3d36de
parent512ad192f705ed7c0fe97ea4d7e8e6ce9029ee53 (diff)
downloadarchweb-7d4b89f3dea9635be081fd053d2ce5d293655702.tar.gz
archweb-7d4b89f3dea9635be081fd053d2ce5d293655702.tar.xz
Add sorting of required_by values
-rw-r--r--main/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 2bc3724..1e7d064 100644
--- a/main/models.py
+++ b/main/models.py
@@ -204,6 +204,10 @@ class Package(models.Model):
).order_by('depname')
for req in requiredby:
reqs.append((req.pkg.id,req.pkg.pkgname))
+ ## sort the resultant array. Django has problems in the orm with
+ ## trying to shoehorn the sorting into the reverse foreign key
+ ## reference in the query above. :(
+ reqs.sort(lambda a,b: cmp(a[1],b[1]))
return reqs
def get_depends(self):