From 71249aa73e2172e575a53d7072d49161e78f4092 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Thu, 29 Oct 2020 13:14:06 +0100 Subject: [PATCH] new fields for project: status, persons --- input/forms.py | 3 ++- input/migrations/0032_auto_20201029_1213.py | 23 +++++++++++++++++++++ input/models.py | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 input/migrations/0032_auto_20201029_1213.py diff --git a/input/forms.py b/input/forms.py index 43d0b1c..8cd05f2 100644 --- a/input/forms.py +++ b/input/forms.py @@ -15,7 +15,8 @@ class ProjectForm(ModelForm): class Meta: model = Project - exclude = ('pid', 'granted', 'granted_date', 'realname', 'email', 'end_mail_send', 'survey_mail_send') + exclude = ('pid', 'granted', 'granted_date', 'realname', 'email',\ + 'end_mail_send', 'survey_mail_send', 'status', 'persons') widgets = {'start': AdminDateWidget(), 'end': AdminDateWidget(),} diff --git a/input/migrations/0032_auto_20201029_1213.py b/input/migrations/0032_auto_20201029_1213.py new file mode 100644 index 0000000..b54fe00 --- /dev/null +++ b/input/migrations/0032_auto_20201029_1213.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.1 on 2020-10-29 12:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('input', '0031_auto_20201028_1402'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='persons', + field=models.IntegerField(default=1), + ), + migrations.AddField( + model_name='project', + name='status', + field=models.CharField(choices=[('RUN', 'läuft'), ('END', 'beendet')], default='RUN', max_length=3), + ), + ] diff --git a/input/models.py b/input/models.py index 4062515..e8e3af4 100644 --- a/input/models.py +++ b/input/models.py @@ -43,6 +43,8 @@ class Project(Volunteer): # the following Fields are not supposed to be edited by users pid = models.CharField(max_length=15, null=True, blank=True) end_mail_send = models.BooleanField(null=True) + 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?