aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'master/autotua/models.py')
-rw-r--r--master/autotua/models.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/master/autotua/models.py b/master/autotua/models.py
index e45293a..c225712 100644
--- a/master/autotua/models.py
+++ b/master/autotua/models.py
@@ -8,6 +8,7 @@
from django.db import models
from django.contrib.auth.models import User
+import process
# Create your models here.
class Job(models.Model):
@@ -19,16 +20,26 @@ class Job(models.Model):
# Using a URL => stage, arch, type, release ignored
stage = models.CharField(max_length=25)
# i686, amd64, g4, etc.
- arch = models.CharField(max_length=25) # choices; const.archs['all']
+ arch = models.CharField(max_length=25)
# Type of stage; hardened, uclibc, etc
#type = CharField(maxlength=25) # const.stage_types
# List of releases?
release = models.CharField(max_length=25)
- # Revision of jobtage tree to use (auto generated)
+ # Revision of jobtage tree to use (not to be entered by user)
jobtagerev = models.CharField(max_length=50)
- # Space-separated list of atoms
+ # Root jobuild atom; auto-converted to deplist
atoms = models.TextField()
# Status of job
#status = models.BooleanField()
+
class Meta:
unique_together = [("name", "maintainer")]
+
+ def __unicode__(self):
+ return '%s/%s' % (self.maintainer, self.name)
+
+ def save(self):
+ atoms = process._get_deplist(self.atoms.split(), self.jobtagerev)
+ print atoms
+ self.atoms = '\n'.join(atoms)
+ super(Job, self).save()