def commit(self): stats = json.dumps(self.stats.__dict__) skills = json.dumps(self.skills) saves = json.dumps(self.saves) attack_bonus = self.base_attack_bonus items = self.items alignment = self.alignment race = self.race name = self.name gold = self.gold level = self.level cclass = self.cclass c = models.character(stats=stats, skills=skills, saves=saves, attack_bonus=attack_bonus, items=items, alignment=alignment, race=race, name=name, gold=gold, level=level, cclass=cclass) c.save()
def charmod(self): stats = json.dumps(self.stats.__dict__) skills = json.dumps(self.skills) saves = json.dumps(self.saves) attack_bonus = self.base_attack_bonus items = self.items alignment = self.alignment race = self.race hp = self.hp name = self.name gold = self.gold level = self.level cclass = self.cclass self.charmod = models.character(hp=hp,stats=stats, skills=skills, saves=saves, attack_bonus=attack_bonus, items=items, alignment=alignment, race=race, name=name, gold=gold, level=level, cclass=cclass) return self.charmod