1
0
Fork 0

added new field survey_mail_date

This commit is contained in:
Benni Bärmann 2021-04-12 13:44:45 +02:00
parent ada102a516
commit f373fceaab
4 changed files with 64 additions and 8 deletions

3
TODO
View File

@ -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.

View File

@ -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(),}

View File

@ -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'),
),
]

View File

@ -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)