Add helper method to package to find self in testing repo
This will be useful in templates getting touched in an upcoming commit. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
edfdc2e38b
commit
b6fb5e02e5
@ -321,6 +321,16 @@ def is_same_version(self, other):
|
||||
and self.pkgver == other.pkgver \
|
||||
and self.pkgrel == other.pkgrel
|
||||
|
||||
def in_testing(self):
|
||||
'''attempt to locate this package in a testing repo; if we are in
|
||||
a testing repo we will always return None.'''
|
||||
if self.repo.testing:
|
||||
return None
|
||||
try:
|
||||
return Package.objects.get(repo__testing=True,
|
||||
pkgname=self.pkgname, arch=self.arch)
|
||||
except Package.DoesNotExist:
|
||||
return None
|
||||
|
||||
class Signoff(models.Model):
|
||||
pkg = models.ForeignKey(Package)
|
||||
|
Loading…
Reference in New Issue
Block a user