From 8bd28385043ea146b76eadbc021db7e7c92c0be1 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 3 Sep 2010 00:47:50 -0500 Subject: 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 --- main/models.py | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.3-24-g4f1b