summaryrefslogtreecommitdiffstats
path: root/releng/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-11-20 19:16:25 -0600
committerDan McGee <dan@archlinux.org>2012-11-20 19:16:25 -0600
commitf7331a0eca351300685ebee494e810d8c82c35b1 (patch)
tree51be653b718cda48187f28f63218d3b3fb44cd26 /releng/models.py
parent160a08bba5324b25abd9e866b884c91d75e597b0 (diff)
downloadarchweb-f7331a0eca351300685ebee494e810d8c82c35b1.tar.gz
archweb-f7331a0eca351300685ebee494e810d8c82c35b1.zip
Add Release model to releng
This should prevent the need for monthly template updates from Pierre and Thomas; best to just let them enter the data themselves and have it show up on the website. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'releng/models.py')
-rw-r--r--releng/models.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/releng/models.py b/releng/models.py
index bd178add..2f9a0785 100644
--- a/releng/models.py
+++ b/releng/models.py
@@ -105,7 +105,24 @@ class Test(models.Model):
comments = models.TextField(null=True, blank=True)
-for model in (Iso, Test):
+class Release(models.Model):
+ release_date = models.DateField(db_index=True)
+ version = models.CharField(max_length=50)
+ kernel_version = models.CharField(max_length=50, blank=True)
+ torrent_infohash = models.CharField(max_length=64, blank=True)
+ created = models.DateTimeField(editable=False)
+ available = models.BooleanField(default=True)
+ info = models.TextField('Public information', blank=True)
+
+ class Meta:
+ get_latest_by = 'release_date'
+ ordering = ('-release_date', '-version')
+
+ def __unicode__(self):
+ return self.version
+
+
+for model in (Iso, Test, Release):
pre_save.connect(set_created_field, sender=model,
dispatch_uid="releng.models")