Rework traits support. Also support getting traits out of the client via phobos
This commit is contained in:
@@ -1,31 +1,22 @@
|
||||
|
||||
from sqlalchemy import Column, Table, Integer, Float, String, ForeignKey, and_, select
|
||||
from sqlalchemy import Column, Table, Integer, String, ForeignKey, and_, select
|
||||
from sqlalchemy.orm import mapper, column_property
|
||||
from eos.types import Item, Traits
|
||||
from eos.db import gamedata_meta
|
||||
|
||||
traits_table = Table("invtraits", gamedata_meta,
|
||||
Column("traitID", Integer, primary_key=True),
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID")),
|
||||
Column("skillID", Integer, ForeignKey("invtypes.typeID")),
|
||||
Column("bonus", Float),
|
||||
Column("bonusText", String),
|
||||
Column("unitID", Integer))
|
||||
|
||||
|
||||
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True),
|
||||
Column("skillID", Integer, ForeignKey("invtypes.typeID"), primary_key=True),
|
||||
Column("bonusText", String, primary_key=True))
|
||||
|
||||
|
||||
from .item import items_table
|
||||
from .unit import groups_table
|
||||
|
||||
|
||||
mapper(Traits, traits_table,
|
||||
properties = {"skillName" : column_property(
|
||||
properties = {"skillName" : column_property(
|
||||
select([items_table.c.typeName],
|
||||
and_(
|
||||
items_table.c.typeID == traits_table.c.skillID,
|
||||
traits_table.c.skillID != -1
|
||||
))),
|
||||
"unit" : column_property(
|
||||
select([groups_table.c.displayName],
|
||||
and_(
|
||||
groups_table.c.unitID == traits_table.c.unitID
|
||||
)))
|
||||
});
|
||||
});
|
||||
|
||||
@@ -59,6 +59,7 @@ if __name__ == "__main__":
|
||||
"invmetagroups": eos.gamedata.MetaGroup,
|
||||
"invmetatypes": eos.gamedata.MetaType,
|
||||
"invtypes": eos.gamedata.Item,
|
||||
"phobostraits": eos.gamedata.Traits,
|
||||
"marketProxy()_GetMarketGroups()": eos.gamedata.MarketGroup}
|
||||
|
||||
fieldMapping = {"icons": {"id": "iconID"}}
|
||||
|
||||
Reference in New Issue
Block a user