|
@ -87,9 +87,10 @@ class Project(Volunteer): |
|
|
notes = models.TextField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen') |
|
|
notes = models.TextField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen') |
|
|
intern_notes = models.TextField(max_length=1000, blank=True, verbose_name="interne Anmerkungen") |
|
|
intern_notes = models.TextField(max_length=1000, blank=True, verbose_name="interne Anmerkungen") |
|
|
|
|
|
|
|
|
|
|
|
end_mail_send = models.BooleanField(null=True, verbose_name='Endmail versenden') |
|
|
|
|
|
|
|
|
# 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, verbose_name='Endmail versenden') |
|
|
|
|
|
status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet'),('NOT','nicht stattgefunden')),default='RUN') |
|
|
status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet'),('NOT','nicht stattgefunden')),default='RUN') |
|
|
persons = models.IntegerField(default=1) |
|
|
persons = models.IntegerField(default=1) |
|
|
finance_id = models.CharField(max_length=15, null= True, blank=True) |
|
|
finance_id = models.CharField(max_length=15, null= True, blank=True) |
|
@ -149,6 +150,8 @@ TRANSPORT_CHOICES = {'BAHN': 'Bahn', |
|
|
PAYEDBY_CHOICES = {'WMDE': 'WMDE', |
|
|
PAYEDBY_CHOICES = {'WMDE': 'WMDE', |
|
|
'REQU': 'Antragstellender Mensch'} |
|
|
'REQU': 'Antragstellender Mensch'} |
|
|
|
|
|
|
|
|
|
|
|
from django.contrib.contenttypes.models import ContentType |
|
|
|
|
|
|
|
|
class Travel(Volunteer): |
|
|
class Travel(Volunteer): |
|
|
# project variable is now null true and blank true, which means it can be saved without project id to be later on filled out by admins |
|
|
# project variable is now null true and blank true, which means it can be saved without project id to be later on filled out by admins |
|
|
project = models.ForeignKey(Project, on_delete=models.CASCADE, null=True, blank=True) |
|
|
project = models.ForeignKey(Project, on_delete=models.CASCADE, null=True, blank=True) |
|
@ -164,6 +167,26 @@ class Travel(Volunteer): |
|
|
notes = models.TextField(max_length=1000, blank=True, verbose_name='Anmerkungen') |
|
|
notes = models.TextField(max_length=1000, blank=True, verbose_name='Anmerkungen') |
|
|
request_url = models.URLField(max_length=2000, verbose_name='Antrag (URL)') |
|
|
request_url = models.URLField(max_length=2000, verbose_name='Antrag (URL)') |
|
|
intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') |
|
|
intern_notes = models.TextField(max_length=1000, blank=True, verbose_name='interne Anmerkungen') |
|
|
|
|
|
project_end = models.DateField(blank=True, null=True, verbose_name='Projektende') |
|
|
|
|
|
# use content type model to get the end date for the project foreign key |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from django.db.models.signals import pre_save |
|
|
|
|
|
from django.dispatch import receiver |
|
|
|
|
|
|
|
|
|
|
|
@receiver(pre_save, sender=Travel, dispatch_uid="get_project_end") |
|
|
|
|
|
def getProjectEnd(sender, instance, **kwargs): |
|
|
|
|
|
#instance.project_end = instance.project.end |
|
|
|
|
|
instance.project_end = instance.project.end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# def save(self,*args,**kwargs): |
|
|
|
|
|
# '''we generate the autogenerated fields here''' |
|
|
|
|
|
# # we don't call save with args/kwargs to avoid UNIQUE CONSTRAINT errors |
|
|
|
|
|
# # but maybe there is a better solution? |
|
|
|
|
|
# intern_notes |
|
|
|
|
|
# project_end = self.checkout |
|
|
|
|
|
# super(Travel, self).save(*args,**kwargs) |
|
|
|
|
|
|
|
|
#abstract base class for Library and IFG |
|
|
#abstract base class for Library and IFG |
|
|
class Grant(Extern): |
|
|
class Grant(Extern): |
|
|