diff options
author | Dan McGee <dan@archlinux.org> | 2012-11-20 19:16:25 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-11-20 19:16:25 -0600 |
commit | f7331a0eca351300685ebee494e810d8c82c35b1 (patch) | |
tree | 51be653b718cda48187f28f63218d3b3fb44cd26 /releng/models.py | |
parent | 160a08bba5324b25abd9e866b884c91d75e597b0 (diff) |
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.py | 19 |
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") |