From 3ff7cd66b0ae6ba7c76a50f3a7e26d6f55727420 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 6 Oct 2020 15:15:05 +0200 Subject: [PATCH] more for generating keys (broken version) --- input/models.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/input/models.py b/input/models.py index 8937d92..bcfccdc 100644 --- a/input/models.py +++ b/input/models.py @@ -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 - - # def save(self,*args,**kwargs): - # self.pid = - # super().save(*args,*kwargs) - # + 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 __str__(self): return self.name