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>
This commit is contained in:
Dan McGee 2010-09-03 00:47:50 -05:00
parent 519460c7e2
commit 8bd2838504

View File

@ -329,6 +329,13 @@ def in_testing(self):
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)