Migrate character editor to use new entity editor.

This commit is contained in:
blitzmann
2016-03-28 21:23:27 -04:00
parent 3315d27d45
commit a3d9d5cca8
9 changed files with 194 additions and 231 deletions

View File

@@ -37,6 +37,7 @@ characters_table = Table("characters", saveddata_meta,
mapper(Character, characters_table,
properties = {
"savedName": characters_table.c.name,
"_Character__owner": relation(
User,
backref = "characters"),

View File

@@ -154,7 +154,7 @@ def getCharacter(lookfor, eager=None):
elif isinstance(lookfor, basestring):
eager = processEager(eager)
with sd_lock:
character = saveddata_session.query(Character).options(*eager).filter(Character.name == lookfor).first()
character = saveddata_session.query(Character).options(*eager).filter(Character.savedName == lookfor).first()
else:
raise TypeError("Need integer or string as argument")
return character