diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-09-14 00:36:47 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-09-14 00:36:47 -0300 |
commit | 60a1fc6cc4cef0b9eed58ea4f0ca003b76ec382a (patch) | |
tree | 032ae62668538be964f57a12018d1ab9f696be5f /releng/models.py | |
parent | fbd23db51b7160a308cd88e407e676994eb08b10 (diff) | |
parent | 617550628b39f94e6cb11ec032eb18e6195bf64a (diff) |
Merge branch 'master' of git://projects.archlinux.org/archweb
Conflicts:
local_settings.py.example
media/archweb.css
packages/templatetags/package_extras.py
public/views.py
templates/packages/details.html
templates/packages/flag.html
templates/packages/flag_confirmed.html
templates/packages/flagged.html
templates/packages/packages_list.html
templates/packages/search.html
templates/packages/signoffs.html
templates/public/about.html
templates/public/download.html
templates/public/index.html
templates/public/svn.html
templates/releng/results.html
templates/todolists/view.html
Diffstat (limited to 'releng/models.py')
-rw-r--r-- | releng/models.py | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/releng/models.py b/releng/models.py index 5510db6a..56187766 100644 --- a/releng/models.py +++ b/releng/models.py @@ -1,3 +1,4 @@ +from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import pre_save @@ -9,52 +10,34 @@ class IsoOption(models.Model): def __unicode__(self): return self.name - def get_test_result(self, success): - try: - return self.test_set.filter(success=success).select_related( - 'iso').latest('iso__id').iso - except Test.DoesNotExist: - return None - - def get_last_success(self): - return self.get_test_result(True) - - def get_last_failure(self): - return self.get_test_result(False) - class Meta: abstract = True class RollbackOption(IsoOption): - def get_rollback_test_result(self, success): - try: - return self.rollback_test_set.filter(success=success).select_related( - 'iso').latest('iso__id').iso - except Test.DoesNotExist: - return None - - def get_last_rollback_success(self): - return self.get_rollback_test_result(True) - - def get_last_rollback_failure(self): - return self.get_rollback_test_result(False) - class Meta: abstract = True class Iso(models.Model): name = models.CharField(max_length=255) created = models.DateTimeField(editable=False) + removed = models.DateTimeField(null=True, blank=True, default=None) active = models.BooleanField(default=True) + def get_absolute_url(self): + return reverse('releng-results-iso', args=[self.pk]) + def __unicode__(self): return self.name + class Meta: + verbose_name = 'ISO' + class Architecture(IsoOption): pass class IsoType(IsoOption): - pass + class Meta: + verbose_name = 'ISO type' class BootType(IsoOption): pass |