diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-25 19:35:23 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-05-25 19:35:23 -0400 |
commit | 824bd93116c4c0a48d7112ae0bceb46e70851df5 (patch) | |
tree | 21285571c08e286891b8e7740c543941798fe778 /packages/models.py | |
parent | 7ccaa7be630e50ce40182d168d41c2f333005443 (diff) | |
parent | 1a1fd4a3d6aa7f6b2338f7751f5f97a30a059a04 (diff) |
Merge branch 'archweb-generic' into master-nomake
Conflicts:
templates/public/download.html
Diffstat (limited to 'packages/models.py')
-rw-r--r-- | packages/models.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/models.py b/packages/models.py index 6477d412..da8adc56 100644 --- a/packages/models.py +++ b/packages/models.py @@ -28,6 +28,9 @@ class PackageRelation(models.Model): type = models.PositiveIntegerField(choices=TYPE_CHOICES, default=MAINTAINER) created = models.DateTimeField(editable=False) + class Meta: + unique_together = (('pkgbase', 'user', 'type'),) + def get_associated_packages(self): return Package.objects.normal().filter(pkgbase=self.pkgbase) @@ -35,13 +38,13 @@ class PackageRelation(models.Model): packages = self.get_associated_packages() return sorted({p.repo for p in packages}) + def last_update(self): + return Update.objects.filter(pkgbase=self.pkgbase).latest() + def __unicode__(self): return u'%s: %s (%s)' % ( self.pkgbase, self.user, self.get_type_display()) - class Meta: - unique_together = (('pkgbase', 'user', 'type'),) - class SignoffSpecificationManager(models.Manager): def get_from_package(self, pkg): |