mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Add a couple more pokemon -> ability accessors.
This commit is contained in:
parent
97975e8214
commit
59dfb885e1
1 changed files with 9 additions and 0 deletions
|
@ -2366,6 +2366,7 @@ Move.flavor_text = relationship(MoveFlavorText,
|
|||
Move.generation = relationship(Generation,
|
||||
innerjoin=True,
|
||||
backref='moves')
|
||||
# XXX should this be a dict mapping version group to number?
|
||||
Move.machines = relationship(Machine,
|
||||
backref='move')
|
||||
Move.meta = relationship(MoveMeta,
|
||||
|
@ -2502,6 +2503,11 @@ Pokemon.hidden_ability = relationship(Ability,
|
|||
uselist=False,
|
||||
backref=backref('hidden_pokemon', order_by=Pokemon.order),
|
||||
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,
|
||||
primaryjoin=Pokemon.id==PokemonForm.pokemon_id,
|
||||
order_by=(PokemonForm.order.asc(), PokemonForm.form_identifier.asc()),
|
||||
|
@ -2529,6 +2535,9 @@ Pokemon.types = relationship(Type,
|
|||
order_by=PokemonType.slot.asc(),
|
||||
backref=backref('pokemon', order_by=Pokemon.order))
|
||||
|
||||
PokemonAbility.ability = relationship(Ability,
|
||||
innerjoin=True)
|
||||
|
||||
PokemonDexNumber.pokedex = relationship(Pokedex,
|
||||
innerjoin=True, lazy='joined')
|
||||
|
||||
|
|
Loading…
Reference in a new issue