From 8d4ba91d521381b136a07f4e732c9126d1e06a6d Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 2 Nov 2020 11:56:07 +0100 Subject: [PATCH] project modell finished --- input/forms.py | 2 +- input/migrations/0036_auto_20201102_1049.py | 98 +++++++++++++++++++++ input/migrations/0037_auto_20201102_1054.py | 58 ++++++++++++ input/migrations/0038_auto_20201102_1055.py | 58 ++++++++++++ input/models.py | 10 ++- 5 files changed, 223 insertions(+), 3 deletions(-) create mode 100644 input/migrations/0036_auto_20201102_1049.py create mode 100644 input/migrations/0037_auto_20201102_1054.py create mode 100644 input/migrations/0038_auto_20201102_1055.py diff --git a/input/forms.py b/input/forms.py index 0ae050b..f069b9d 100644 --- a/input/forms.py +++ b/input/forms.py @@ -16,7 +16,7 @@ class ProjectForm(ModelForm): class Meta: model = Project exclude = ('pid', 'granted', 'granted_date', 'realname', 'email',\ - 'end_mail_send', 'survey_mail_send', 'status', 'persons') + 'end_mail_send', 'status', 'persons') widgets = {'start': AdminDateWidget(), 'end': AdminDateWidget(),} diff --git a/input/migrations/0036_auto_20201102_1049.py b/input/migrations/0036_auto_20201102_1049.py new file mode 100644 index 0000000..295d4c0 --- /dev/null +++ b/input/migrations/0036_auto_20201102_1049.py @@ -0,0 +1,98 @@ +# Generated by Django 3.1.1 on 2020-11-02 10:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0035_auto_20201102_0944'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='cost', + field=models.IntegerField(blank=True, null=True), + ), + migrations.AddField( + model_name='project', + name='granted_from', + field=models.CharField(max_length=100, null=True, verbose_name='Bewilligt von'), + ), + migrations.AddField( + model_name='project', + name='insurance', + field=models.BooleanField(default=False, verbose_name='Haftpflichtversicherung'), + ), + migrations.AddField( + model_name='project', + name='insurance_technic', + field=models.BooleanField(default=False, verbose_name='Technikversicherung Ausland'), + ), + migrations.AddField( + model_name='project', + name='notes', + field=models.CharField(blank=True, max_length=1000, null=True, verbose_name='Anmerkungen'), + ), + migrations.AddField( + model_name='project', + name='participants_estimated', + field=models.IntegerField(blank=True, null=True, verbose_name='Teilnehmende angefragt'), + ), + migrations.AddField( + model_name='project', + name='participants_real', + field=models.IntegerField(blank=True, null=True, verbose_name='Teilnehmende ausgezählt'), + ), + migrations.AddField( + model_name='project', + name='support', + field=models.CharField(blank=True, max_length=300, null=True, verbose_name='Betreuungsperson und Vertretung'), + ), + migrations.AlterField( + model_name='businesscard', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='email', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='honorarycertificate', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='ifg', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='library', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='list', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='literature', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='project', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='travel', + name='survey_mail_send', + field=models.BooleanField(null=True, verbose_name='Keine Umfragemail schicken'), + ), + ] diff --git a/input/migrations/0037_auto_20201102_1054.py b/input/migrations/0037_auto_20201102_1054.py new file mode 100644 index 0000000..03819ed --- /dev/null +++ b/input/migrations/0037_auto_20201102_1054.py @@ -0,0 +1,58 @@ +# Generated by Django 3.1.1 on 2020-11-02 10:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0036_auto_20201102_1049'), + ] + + operations = [ + migrations.AlterField( + model_name='businesscard', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='email', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='honorarycertificate', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='ifg', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='library', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='list', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='literature', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='project', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='travel', + name='survey_mail_send', + field=models.BooleanField(default=False, null=True, verbose_name='Keine Umfragemail schicken'), + ), + ] diff --git a/input/migrations/0038_auto_20201102_1055.py b/input/migrations/0038_auto_20201102_1055.py new file mode 100644 index 0000000..203887e --- /dev/null +++ b/input/migrations/0038_auto_20201102_1055.py @@ -0,0 +1,58 @@ +# Generated by Django 3.1.1 on 2020-11-02 10:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0037_auto_20201102_1054'), + ] + + operations = [ + migrations.AlterField( + model_name='businesscard', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='email', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='honorarycertificate', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='ifg', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='library', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='list', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='literature', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='project', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + migrations.AlterField( + model_name='travel', + name='survey_mail_send', + field=models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken'), + ), + ] diff --git a/input/models.py b/input/models.py index 02dbcdb..d0c8a4b 100644 --- a/input/models.py +++ b/input/models.py @@ -12,7 +12,7 @@ class Volunteer(models.Model): # the following Fields are not supposed to be edited by users granted = models.BooleanField(null=True) granted_date = models.DateField(null=True) - survey_mail_send = models.BooleanField(null=True) + survey_mail_send = models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken') @classmethod def set_granted(cl, key, b): @@ -54,9 +54,14 @@ class Project(Volunteer): location = models.CharField(max_length=2000, null=True, blank=True, verbose_name="Ort/Adresse/Location") participants_estimated = models.IntegerField(blank=True, null=True, verbose_name='Teilnehmende angefragt') participants_real = models.IntegerField(blank=True, null=True, verbose_name='Teilnehmende ausgezählt') - + insurance = models.BooleanField(default=False, verbose_name='Haftpflichtversicherung') + insurance_technic = models.BooleanField(default=False, verbose_name='Technikversicherung Ausland') + support = models.CharField(max_length=300, blank=True, null=True, verbose_name='Betreuungsperson und Vertretung') + cost = models.IntegerField(blank=True, null=True) account = models.CharField('Kostenstelle', max_length=5, choices=ACCOUNTS.items(), null=True,) + granted_from = models.CharField(max_length=100,null=True,verbose_name='Bewilligt von') + notes = models.CharField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen') # the following Fields are not supposed to be edited by users pid = models.CharField(max_length=15, null=True, blank=True) @@ -64,6 +69,7 @@ class Project(Volunteer): status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet')),default='RUN') persons = models.IntegerField(default=1) + def save(self,*args,**kwargs): # is there a way to call super().save() only once? super().save(*args,*kwargs)