Add a couple more pokemon -> ability accessors.

This commit is contained in:
Eevee 2012-11-17 01:40:07 -08:00
parent 97975e8214
commit 59dfb885e1

View file

@ -2366,6 +2366,7 @@ Move.flavor_text = relationship(MoveFlavorText,
Move.generation = relationship(Generation, Move.generation = relationship(Generation,
innerjoin=True, innerjoin=True,
backref='moves') backref='moves')
# XXX should this be a dict mapping version group to number?
Move.machines = relationship(Machine, Move.machines = relationship(Machine,
backref='move') backref='move')
Move.meta = relationship(MoveMeta, Move.meta = relationship(MoveMeta,
@ -2502,6 +2503,11 @@ Pokemon.hidden_ability = relationship(Ability,
uselist=False, uselist=False,
backref=backref('hidden_pokemon', order_by=Pokemon.order), backref=backref('hidden_pokemon', order_by=Pokemon.order),
doc=u"The Pokémon's Hidden Ability") doc=u"The Pokémon's Hidden Ability")
Pokemon.pokemon_abilities = relationship(PokemonAbility,
order_by=PokemonAbility.slot.asc(),
innerjoin=True,
backref=backref('pokemon', order_by=Pokemon.order.asc()),
doc=u"All abilities the Pokémon can have, as bridge rows")
Pokemon.forms = relationship(PokemonForm, Pokemon.forms = relationship(PokemonForm,
primaryjoin=Pokemon.id==PokemonForm.pokemon_id, primaryjoin=Pokemon.id==PokemonForm.pokemon_id,
order_by=(PokemonForm.order.asc(), PokemonForm.form_identifier.asc()), order_by=(PokemonForm.order.asc(), PokemonForm.form_identifier.asc()),
@ -2529,6 +2535,9 @@ Pokemon.types = relationship(Type,
order_by=PokemonType.slot.asc(), order_by=PokemonType.slot.asc(),
backref=backref('pokemon', order_by=Pokemon.order)) backref=backref('pokemon', order_by=Pokemon.order))
PokemonAbility.ability = relationship(Ability,
innerjoin=True)
PokemonDexNumber.pokedex = relationship(Pokedex, PokemonDexNumber.pokedex = relationship(Pokedex,
innerjoin=True, lazy='joined') innerjoin=True, lazy='joined')