From f373fceaab5098f6517cc3a0b0c7658ffcdcf530 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 12 Apr 2021 13:44:45 +0200 Subject: [PATCH] added new field survey_mail_date --- TODO | 3 -- input/forms.py | 8 +-- input/migrations/0059_auto_20210412_1142.py | 58 +++++++++++++++++++++ input/models.py | 3 +- 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 input/migrations/0059_auto_20210412_1142.py diff --git a/TODO b/TODO index 2d98718..badf3ce 100644 --- a/TODO +++ b/TODO @@ -16,6 +16,3 @@ other known problems: missing features: - every modell should store the date when the surveymail was actually send. - -- field which contains URLs should check during validation if there is actually an URL - and not just random strings to prevent wrong input. diff --git a/input/forms.py b/input/forms.py index 2272b60..5dc5c3d 100644 --- a/input/forms.py +++ b/input/forms.py @@ -22,7 +22,7 @@ class ProjectForm(FdbForm): class Meta: model = Project exclude = ('pid', 'granted', 'granted_date', 'realname', 'email',\ - 'end_mail_send', 'status', 'persons') + 'end_mail_send', 'status', 'persons', 'survey_mail_date') widgets = {'start': AdminDateWidget(), 'end': AdminDateWidget(),} @@ -37,7 +37,7 @@ class ExternForm(FdbForm): class Meta: model = Extern - exclude = ('granted', 'granted_date', 'survey_mail_send', 'service_id') + exclude = ('granted', 'granted_date', 'survey_mail_send', 'service_id', 'survey_mail_date') INTERN_CHOICES = {'PRO': 'Projektsteckbrief', 'HON': 'Ehrenamtsbescheinigung, Akkreditierung oder Redaktionsbestätigung', @@ -49,13 +49,13 @@ class InternForm(FdbForm): class Meta: model = Volunteer - exclude = ('granted', 'granted_date', 'survey_mail_send') + exclude = ('granted', 'granted_date', 'survey_mail_send', 'survey_mail_date') class TravelForm(FdbForm): # TODO: add some javascript to show/hide other-field class Meta: model = Travel - exclude = ('granted', 'granted_date', 'survey_mail_send', 'realname', 'email',) + exclude = ('granted', 'granted_date', 'survey_mail_send', 'realname', 'email', 'survey_mail_date') widgets = {'checkin': AdminDateWidget(), 'checkout': AdminDateWidget(),} diff --git a/input/migrations/0059_auto_20210412_1142.py b/input/migrations/0059_auto_20210412_1142.py new file mode 100644 index 0000000..fa19e5c --- /dev/null +++ b/input/migrations/0059_auto_20210412_1142.py @@ -0,0 +1,58 @@ +# Generated by Django 3.1.1 on 2021-04-12 11:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0058_auto_20210412_0946'), + ] + + operations = [ + migrations.AddField( + model_name='businesscard', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='email', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='honorarycertificate', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='ifg', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='library', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='list', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='literature', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='project', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + migrations.AddField( + model_name='travel', + name='survey_mail_date', + field=models.DateField(blank=True, null=True, verbose_name='Umfragemail wurde verschickt am'), + ), + ] diff --git a/input/models.py b/input/models.py index 7fb9647..c01db7d 100644 --- a/input/models.py +++ b/input/models.py @@ -16,7 +16,8 @@ class Volunteer(models.Model): granted = models.BooleanField(null=True) granted_date = models.DateField(null=True) survey_mail_send = models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken') - + survey_mail_date = models.DateField(verbose_name='Umfragemail wurde verschickt am', null=True, blank=True) + @classmethod def set_granted(cl, key, b): obj = cl.objects.get(pk=key)