project modell finished

This commit is contained in:
Benni Bärmann 2020-11-02 11:56:07 +01:00
parent d4815129df
commit 8d4ba91d52
5 changed files with 223 additions and 3 deletions

View File

@ -16,7 +16,7 @@ class ProjectForm(ModelForm):
class Meta: class Meta:
model = Project model = Project
exclude = ('pid', 'granted', 'granted_date', 'realname', 'email',\ exclude = ('pid', 'granted', 'granted_date', 'realname', 'email',\
'end_mail_send', 'survey_mail_send', 'status', 'persons') 'end_mail_send', 'status', 'persons')
widgets = {'start': AdminDateWidget(), widgets = {'start': AdminDateWidget(),
'end': AdminDateWidget(),} 'end': AdminDateWidget(),}

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@ class Volunteer(models.Model):
# the following Fields are not supposed to be edited by users # the following Fields are not supposed to be edited by users
granted = models.BooleanField(null=True) granted = models.BooleanField(null=True)
granted_date = models.DateField(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 @classmethod
def set_granted(cl, key, b): 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") 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_estimated = models.IntegerField(blank=True, null=True, verbose_name='Teilnehmende angefragt')
participants_real = models.IntegerField(blank=True, null=True, verbose_name='Teilnehmende ausgezählt') 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, account = models.CharField('Kostenstelle', max_length=5,
choices=ACCOUNTS.items(), null=True,) 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 # 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)
@ -64,6 +69,7 @@ class Project(Volunteer):
status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet')),default='RUN') status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet')),default='RUN')
persons = models.IntegerField(default=1) 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?
super().save(*args,*kwargs) super().save(*args,*kwargs)