예제 #1
0
 def save(self, **kwargs):
     if not self.id:
         phrase = "{0} {1} {2}".format(self.player.username, self.name, datetime.now())
         self.guid = generate_secret_token(phrase)
     super(Item, self).save(**kwargs)
예제 #2
0
 def save(self, **kwargs):
     if not self.id:
         phrase = "{0} {1} {2}".format(self.character.name, self.name, datetime.now())
         self.guid = generate_secret_token(phrase)
     self.slug = "{0}-{1}".format(slugify(self.name)[:35], self.guid)
     super(SpellSchool, self).save(**kwargs)