summaryrefslogtreecommitdiff
path: root/releng/models.py
diff options
context:
space:
mode:
authorJohannes Krampf <johannes.krampf@gmail.com>2011-11-26 14:27:45 +0100
committerJohannes Krampf <johannes.krampf@gmail.com>2011-11-26 14:27:45 +0100
commit56c773b32fc68639eb55666b6cfaa32bc9618321 (patch)
treedcc047f0552224facb6d05cddf2fb72b973bd683 /releng/models.py
parentfbd23db51b7160a308cd88e407e676994eb08b10 (diff)
parent85657db05d7f65604340699cfcb9967c9e81a0ef (diff)
Merged with archweb trunk
Diffstat (limited to 'releng/models.py')
-rw-r--r--releng/models.py37
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