more for generating keys (broken version)

This commit is contained in:
Benni Baermann 2020-10-06 15:15:05 +02:00
parent 23b28e0406
commit 3ff7cd66b0

View file

@ -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