|
@ -11,10 +11,10 @@ class Volunteer(models.Model): |
|
|
|
|
|
|
|
|
class Project(Volunteer): |
|
|
class Project(Volunteer): |
|
|
name = models.CharField(max_length=200) |
|
|
name = models.CharField(max_length=200) |
|
|
start = models.DateTimeField('start date') |
|
|
|
|
|
|
|
|
start = models.DateField('start date') |
|
|
# contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True) |
|
|
# contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True) |
|
|
|
|
|
|
|
|
pid = models.IntegerField(null=True) # automaticly generated |
|
|
|
|
|
|
|
|
pid = models.IntegerField(null=True, blank=True) # automaticly generated |
|
|
# @property |
|
|
# @property |
|
|
# def pid(self): |
|
|
# def pid(self): |
|
|
# pid = "hurzel " + self.get_pk |
|
|
# pid = "hurzel " + self.get_pk |
|
@ -22,6 +22,7 @@ class Project(Volunteer): |
|
|
# return pid |
|
|
# return pid |
|
|
|
|
|
|
|
|
def save(self,*args,**kwargs): |
|
|
def save(self,*args,**kwargs): |
|
|
|
|
|
super().save(*args,*kwargs) |
|
|
self.pid = 10000 + self.pk |
|
|
self.pid = 10000 + self.pk |
|
|
super().save(*args,*kwargs) |
|
|
super().save(*args,*kwargs) |
|
|
|
|
|
|
|
|