Some syntax

This commit is contained in:
blitzmann
2015-09-25 14:13:33 -04:00
parent 5b5fdd97d6
commit d0ec17feba
2 changed files with 20 additions and 8 deletions

View File

@@ -36,9 +36,21 @@ characters_table = Table("characters", saveddata_meta,
Column("ownerID", ForeignKey("users.ID"), nullable = True))
mapper(Character, characters_table,
properties = {"_Character__owner" : relation(User, backref = "characters"),
"_Character__skills" : relation(Skill, backref="character", cascade = "all,delete-orphan"),
"_Character__implants" : relation(Implant, collection_class = HandledImplantBoosterList, cascade='all,delete-orphan', single_parent=True,
primaryjoin = charImplants_table.c.charID == characters_table.c.ID,
secondaryjoin = charImplants_table.c.implantID == Implant.ID,
secondary = charImplants_table),})
properties = {
"_Character__owner": relation(
User,
backref = "characters"),
"_Character__skills": relation(
Skill,
backref="character",
cascade = "all,delete-orphan"),
"_Character__implants": relation(
Implant,
collection_class = HandledImplantBoosterList,
cascade='all,delete-orphan',
single_parent=True,
primaryjoin = charImplants_table.c.charID == characters_table.c.ID,
secondaryjoin = charImplants_table.c.implantID == Implant.ID,
secondary = charImplants_table),
}
)

View File

@@ -20,7 +20,7 @@
from sqlalchemy.orm import validates, reconstructor
from eos.effectHandlerHelpers import HandledItem
from eos.effectHandlerHelpers import HandledItem, HandledImplantBoosterList
import eos.db
import eos
@@ -98,7 +98,7 @@ class Character(object):
for item in self.getSkillList():
self.addSkill(Skill(item.ID, self.defaultLevel))
self.__implants = eos.saveddata.fit.HandledImplantBoosterList()
self.__implants = HandledImplantBoosterList()
self.apiKey = None
@reconstructor