forked from beba/foerderbarometer
more for generating keys (broken version)
This commit is contained in:
parent
23b28e0406
commit
3ff7cd66b0
|
@ -14,17 +14,17 @@ class Project(Volunteer):
|
|||
start = models.DateTimeField('start date')
|
||||
# contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True)
|
||||
|
||||
# pid = models.IntegerField(null=True) # automaticly generated
|
||||
@property
|
||||
def pid(self):
|
||||
pid = "hurzel " + self.get_pk
|
||||
print(pid)
|
||||
return pid
|
||||
pid = models.IntegerField(null=True) # automaticly generated
|
||||
# @property
|
||||
# def pid(self):
|
||||
# pid = "hurzel " + self.get_pk
|
||||
# print(pid)
|
||||
# return pid
|
||||
|
||||
def save(self,*args,**kwargs):
|
||||
self.pid = 10000 + self.pk
|
||||
super().save(*args,*kwargs)
|
||||
|
||||
# def save(self,*args,**kwargs):
|
||||
# self.pid =
|
||||
# super().save(*args,*kwargs)
|
||||
#
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
|
Loading…
Reference in New Issue