diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-03 07:47:50 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-03 07:47:50 +0200 |
commit | 8bd28385043ea146b76eadbc021db7e7c92c0be1 (patch) | |
tree | 140fa9ede67e9028def2d60914d18348aed2de7f /main | |
parent | 519460c7e248c6cafdb78a65c6f0221fd12ef886 (diff) | |
download | archweb-8bd28385043ea146b76eadbc021db7e7c92c0be1.tar.gz archweb-8bd28385043ea146b76eadbc021db7e7c92c0be1.tar.xz |
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>
Diffstat (limited to 'main')
-rw-r--r-- | main/models.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py index 2079dee..558d50c 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) |