|
|
@ -12,25 +12,20 @@ class Volunteer(models.Model): |
|
|
|
class Project(Volunteer): |
|
|
|
name = models.CharField(max_length=200) |
|
|
|
start = models.DateField('start date') |
|
|
|
# contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True) |
|
|
|
|
|
|
|
pid = models.IntegerField(null=True, blank=True) # automaticly generated |
|
|
|
# @property |
|
|
|
# def pid(self): |
|
|
|
# pid = "hurzel " + self.get_pk |
|
|
|
# print(pid) |
|
|
|
# return pid |
|
|
|
|
|
|
|
def save(self,*args,**kwargs): |
|
|
|
super().save(*args,*kwargs) |
|
|
|
self.pid = 10000 + self.pk |
|
|
|
super().save(*args,*kwargs) |
|
|
|
# is there a way to call super().save() only once? |
|
|
|
super().save(*args,*kwargs) |
|
|
|
self.pid = 10000 + self.pk |
|
|
|
super().save(*args,*kwargs) |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
return self.name |
|
|
|
|
|
|
|
class HonoraryCertificate(Volunteer): |
|
|
|
request_url = models.CharField(max_length=400) #can urls be longer in theory? |
|
|
|
request_url = models.CharField(max_length=2000) |
|
|
|
number = models.IntegerField(null = True) |
|
|
|
|
|
|
|
def __str__(self): |
|
|
@ -53,7 +48,7 @@ class Library(Grant): |
|
|
|
return self.library |
|
|
|
|
|
|
|
class IFG(Grant): |
|
|
|
url = models.CharField(max_length=400) #can urls be longer in theory? |
|
|
|
url = models.CharField(max_length=2000) |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
return "IFG-Anfrage von " + self.realname |