diff options
author | Dusty Phillips <buchuki@gmail.com> | 2008-08-16 19:36:15 +0200 |
---|---|---|
committer | Dusty Phillips <buchuki@gmail.com> | 2008-08-16 19:36:15 +0200 |
commit | ac63cc4101da73e5b1b4424c53f29033557c6596 (patch) | |
tree | 34e02c6288290f93d5a8be2d13e7183d77a1690a /main | |
parent | e1fa499f637e00f5e7eb91ec460903558b46017a (diff) | |
download | archweb-ac63cc4101da73e5b1b4424c53f29033557c6596.tar.gz archweb-ac63cc4101da73e5b1b4424c53f29033557c6596.tar.xz |
#10340 Integrated Signoffs completed but untested
Diffstat (limited to 'main')
-rw-r--r-- | main/models.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/main/models.py b/main/models.py index 7cd00bf..49df21e 100644 --- a/main/models.py +++ b/main/models.py @@ -225,6 +225,17 @@ class Package(models.Model): return '/packages/%s/%s/%s/' % (self.repo.name.lower(), self.arch.name, self.pkgname) + @property + def signoffs(self): + return Signoff.objects.filter( + pkg=self, + pkgver=self.pkgver, + pkgrel=self.pkgrel) + + def approved_for_signoff(self): + return self.signoffs.count() >= 2 + + def get_requiredby(self): """ Returns a list of package objects. @@ -270,12 +281,7 @@ class Signoff(models.Model): pkg = models.ForeignKey(Package) pkgver = models.CharField(maxlength=255) pkgrel = models.CharField(maxlength=255) - signed_off = models.ManyToManyField(User) - - def is_approved(self): - if signed_off.all().count() > 2: - return True - return False + packager = models.ForeignKey(User) class PackageFile(models.Model): id = models.AutoField(primary_key=True) |