From 17648e90c4d5af2dc2dab0641cec4735cbbc9c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=2E=20Geisler=20=26=20B=2E=20H=C3=A4ttasch?= <ak@kif.rocks> Date: Wed, 8 Jan 2020 19:53:48 +0100 Subject: [PATCH] add "last updated" field to AK Slot --- AKModel/migrations/0026_akslot_updated.py | 17 +++++++++++++++++ AKModel/models.py | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 AKModel/migrations/0026_akslot_updated.py diff --git a/AKModel/migrations/0026_akslot_updated.py b/AKModel/migrations/0026_akslot_updated.py new file mode 100644 index 00000000..a22023be --- /dev/null +++ b/AKModel/migrations/0026_akslot_updated.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.6 on 2019-10-31 00:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('AKModel', '0025_contact_email'), + ] + + operations = [ + migrations.AddField( + model_name='akslot', + name='updated', + field=models.DateTimeField(auto_now=True, verbose_name='Last update'), + ), + ] diff --git a/AKModel/models.py b/AKModel/models.py index 57c35f41..45319e30 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -24,7 +24,8 @@ class Event(models.Model): help_text='Default length in hours that is assumed for AKs in this event.') contact_email = models.EmailField(verbose_name=_("Contact email address"), blank=True, - help_text=_("An email address that is displayed on every page and can be used for all kinds of questions")) + help_text=_( + "An email address that is displayed on every page and can be used for all kinds of questions")) class Meta: verbose_name = _('Event') @@ -263,6 +264,8 @@ class AKSlot(models.Model): event = models.ForeignKey(to=Event, on_delete=models.CASCADE, verbose_name=_('Event'), help_text=_('Associated event')) + updated = models.DateTimeField(auto_now=True, verbose_name=_("Last update")) + class Meta: verbose_name = _('AK Slot') verbose_name_plural = _('AK Slots') -- GitLab