summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-08-16 13:36:15 -0400
committerDusty Phillips <buchuki@gmail.com>2008-08-16 13:36:15 -0400
commitac63cc4101da73e5b1b4424c53f29033557c6596 (patch)
tree34e02c6288290f93d5a8be2d13e7183d77a1690a /main/models.py
parente1fa499f637e00f5e7eb91ec460903558b46017a (diff)
#10340 Integrated Signoffs completed but untested
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/main/models.py b/main/models.py
index 7cd00bff..49df21eb 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)