new fields for project: status, persons

This commit is contained in:
Benni Bärmann 2020-10-29 13:14:06 +01:00
parent a903e5ed1f
commit 71249aa73e
3 changed files with 27 additions and 1 deletions

View File

@ -15,7 +15,8 @@ class ProjectForm(ModelForm):
class Meta: class Meta:
model = Project 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(), widgets = {'start': AdminDateWidget(),
'end': AdminDateWidget(),} 'end': AdminDateWidget(),}

View File

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

View File

@ -43,6 +43,8 @@ class Project(Volunteer):
# the following Fields are not supposed to be edited by users # the following Fields are not supposed to be edited by users
pid = models.CharField(max_length=15, null=True, blank=True) pid = models.CharField(max_length=15, null=True, blank=True)
end_mail_send = models.BooleanField(null=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): def save(self,*args,**kwargs):
# is there a way to call super().save() only once? # is there a way to call super().save() only once?