summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-09-03 00:47:50 -0500
committerDan McGee <dan@archlinux.org>2010-09-03 00:47:50 -0500
commit8bd28385043ea146b76eadbc021db7e7c92c0be1 (patch)
tree140fa9ede67e9028def2d60914d18348aed2de7f
parent519460c7e248c6cafdb78a65c6f0221fd12ef886 (diff)
Add ability to get versions of a package elsewhere
E.g. if we are looking at one version for a particular architecture, I want to see all versions for all architectures in all repositories. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--main/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 2079deeb..558d50c6 100644
--- a/main/models.py
+++ b/main/models.py
@@ -329,6 +329,13 @@ class Package(models.Model):
except Package.DoesNotExist:
return None
+ def elsewhere(self):
+ '''attempt to locate this package anywhere else, regardless of
+ architecture or repository. Excludes this package from the list.'''
+ return Package.objects.select_related('arch', 'repo').filter(
+ pkgname=self.pkgname).exclude(id=self.id).order_by(
+ 'arch__name', 'repo__name')
+
class Signoff(models.Model):
pkg = models.ForeignKey(Package)
pkgver = models.CharField(max_length=255)