new fields for project: status, persons
This commit is contained in:
parent
a903e5ed1f
commit
71249aa73e
|
@ -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(),}
|
||||||
|
|
||||||
|
|
|
@ -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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -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…
Reference in New Issue