Browse Source

new fields for project: status, persons

master
Benni Baermann 4 years ago
parent
commit
71249aa73e
3 changed files with 27 additions and 1 deletions
  1. +2
    -1
      input/forms.py
  2. +23
    -0
      input/migrations/0032_auto_20201029_1213.py
  3. +2
    -0
      input/models.py

+ 2
- 1
input/forms.py 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(),}

+ 23
- 0
input/migrations/0032_auto_20201029_1213.py 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),
),
]

+ 2
- 0
input/models.py 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?

Loading…
Cancel
Save