class ItemPocket(TableBase):
__tablename__ = 'item_pockets'
id = Column(Integer, primary_key=True, nullable=False)
+ identifier = Column(Unicode(16), nullable=False)
name = Column(Unicode(16), nullable=False)
class Language(TableBase):
damage_class_id = Column(Integer, ForeignKey('move_damage_classes.id'), nullable=False)
effect_id = Column(Integer, ForeignKey('move_effects.id'), nullable=False)
effect_chance = Column(Integer)
- contest_type = Column(Unicode(8), nullable=False)
+ contest_type_id = Column(Integer, ForeignKey('contest_types.id'), nullable=True)
contest_effect_id = Column(Integer, ForeignKey('contest_effects.id'), nullable=True)
super_contest_effect_id = Column(Integer, ForeignKey('super_contest_effects.id'), nullable=False)
Item.berry = relation(Berry, uselist=False, backref='item')
Item.fling_effect = relation(ItemFlingEffect, backref='items')
-Item.category = relation(ItemCategory, backref='items')
+Item.category = relation(ItemCategory)
+Item.pocket = association_proxy('category', 'pocket')
-ItemCategory.pocket = relation(ItemPocket, backref='categories')
+ItemCategory.items = relation(Item, order_by=Item.name)
+ItemCategory.pocket = relation(ItemPocket)
+
+ItemPocket.categories = relation(ItemCategory, order_by=ItemCategory.name)
Location.region = relation(Region, backref='locations')
Move.contest_effect = relation(ContestEffect, backref='moves')
Move.contest_combo_next = association_proxy('contest_combo_first', 'second')
Move.contest_combo_prev = association_proxy('contest_combo_second', 'first')
+Move.contest_type = relation(ContestType, backref='moves')
Move.damage_class = relation(MoveDamageClass, backref='moves')
Move.flags = association_proxy('move_flags', 'flag')
Move.flavor_text = relation(MoveFlavorText, order_by=MoveFlavorText.generation_id, backref='move')