diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-15 01:01:30 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-15 01:01:30 -0400 |
commit | 7a8b5707b277f052b712c51574b0e28834b5a5f8 (patch) | |
tree | 18691be7e163ae7d93b812fd31fc8e51693f7bd2 /releng | |
parent | 88d96927964a3c9dd1effa73b613df536aa2a0c4 (diff) | |
parent | e7449f7063f3f56af118ed8ad703ec3fce6bc39a (diff) |
Merge tag 'release_2014-10-28' into archweb-generic
Fix django_countries issues
Diffstat (limited to 'releng')
-rw-r--r-- | releng/admin.py | 1 | ||||
-rw-r--r-- | releng/migrations/0002_release_last_modified.py | 22 | ||||
-rw-r--r-- | releng/migrations/0003_release_populate_last_modified.py | 21 | ||||
-rw-r--r-- | releng/models.py | 1 |
4 files changed, 45 insertions, 0 deletions
diff --git a/releng/admin.py b/releng/admin.py index c7e6396e..9c93c4be 100644 --- a/releng/admin.py +++ b/releng/admin.py @@ -18,6 +18,7 @@ class ReleaseAdmin(admin.ModelAdmin): list_display = ('version', 'release_date', 'kernel_version', 'available', 'created') list_filter = ('available', 'release_date') + readonly_fields = ('created', 'last_modified') SIMPLE_MODELS = (Architecture, BootType, Bootloader, ClockChoice, Filesystem, diff --git a/releng/migrations/0002_release_last_modified.py b/releng/migrations/0002_release_last_modified.py new file mode 100644 index 00000000..58502452 --- /dev/null +++ b/releng/migrations/0002_release_last_modified.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import datetime +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('releng', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='release', + name='last_modified', + field=models.DateTimeField(default=datetime.datetime(2001, 1, 1, tzinfo=utc), editable=False), + preserve_default=False, + ), + ] diff --git a/releng/migrations/0003_release_populate_last_modified.py b/releng/migrations/0003_release_populate_last_modified.py new file mode 100644 index 00000000..ec7b6fda --- /dev/null +++ b/releng/migrations/0003_release_populate_last_modified.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + +def forwards(apps, schema_editor): + Release = apps.get_model('releng', 'Release') + Release.objects.update(last_modified=models.F('created')) + +def backwards(apps, schema_editor): + pass + +class Migration(migrations.Migration): + + dependencies = [ + ('releng', '0002_release_last_modified'), + ] + + operations = [ + migrations.RunPython(forwards, backwards) + ] diff --git a/releng/models.py b/releng/models.py index 66690e81..2f9216bd 100644 --- a/releng/models.py +++ b/releng/models.py @@ -120,6 +120,7 @@ class Release(models.Model): md5_sum = models.CharField('MD5 digest', max_length=32, blank=True) sha1_sum = models.CharField('SHA1 digest', max_length=40, blank=True) created = models.DateTimeField(editable=False) + last_modified = models.DateTimeField(editable=False) available = models.BooleanField(default=True) info = models.TextField('Public information', blank=True) torrent_data = models.TextField(blank=True, |