Browse Source

more for generating keys (broken version)

master
Benni Baermann 4 years ago
parent
commit
3ff7cd66b0
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      input/models.py

+ 11
- 11
input/models.py 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
# 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

Loading…
Cancel
Save