Browse Source

added new field survey_mail_date

master
Benni Baermann 3 years ago
parent
commit
f373fceaab
4 changed files with 64 additions and 8 deletions
  1. +0
    -3
      TODO
  2. +4
    -4
      input/forms.py
  3. +58
    -0
      input/migrations/0059_auto_20210412_1142.py
  4. +2
    -1
      input/models.py

+ 0
- 3
TODO View File

@ -16,6 +16,3 @@ other known problems:
missing features: missing features:
- every modell should store the date when the surveymail was actually send. - 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.

+ 4
- 4
input/forms.py View File

@ -22,7 +22,7 @@ class ProjectForm(FdbForm):
class Meta: class Meta:
model = Project model = Project
exclude = ('pid', 'granted', 'granted_date', 'realname', 'email',\ exclude = ('pid', 'granted', 'granted_date', 'realname', 'email',\
'end_mail_send', 'status', 'persons')
'end_mail_send', 'status', 'persons', 'survey_mail_date')
widgets = {'start': AdminDateWidget(), widgets = {'start': AdminDateWidget(),
'end': AdminDateWidget(),} 'end': AdminDateWidget(),}
@ -37,7 +37,7 @@ class ExternForm(FdbForm):
class Meta: class Meta:
model = Extern 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', INTERN_CHOICES = {'PRO': 'Projektsteckbrief',
'HON': 'Ehrenamtsbescheinigung, Akkreditierung oder Redaktionsbestätigung', 'HON': 'Ehrenamtsbescheinigung, Akkreditierung oder Redaktionsbestätigung',
@ -49,13 +49,13 @@ class InternForm(FdbForm):
class Meta: class Meta:
model = Volunteer model = Volunteer
exclude = ('granted', 'granted_date', 'survey_mail_send')
exclude = ('granted', 'granted_date', 'survey_mail_send', 'survey_mail_date')
class TravelForm(FdbForm): class TravelForm(FdbForm):
# TODO: add some javascript to show/hide other-field # TODO: add some javascript to show/hide other-field
class Meta: class Meta:
model = Travel 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(), widgets = {'checkin': AdminDateWidget(),
'checkout': AdminDateWidget(),} 'checkout': AdminDateWidget(),}

+ 58
- 0
input/migrations/0059_auto_20210412_1142.py 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'),
),
]

+ 2
- 1
input/models.py View File

@ -16,7 +16,8 @@ class Volunteer(models.Model):
granted = models.BooleanField(null=True) granted = models.BooleanField(null=True)
granted_date = models.DateField(null=True) granted_date = models.DateField(null=True)
survey_mail_send = models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken') 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 @classmethod
def set_granted(cl, key, b): def set_granted(cl, key, b):
obj = cl.objects.get(pk=key) obj = cl.objects.get(pk=key)

Loading…
Cancel
Save