mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Eagerload Pokemon.forms.
This fixes all those spline-pokedex tests that broke when I fixed Pokémon name display.
This commit is contained in:
parent
75287587a2
commit
cdf052555b
1 changed files with 2 additions and 1 deletions
|
@ -1944,7 +1944,8 @@ Pokemon.dream_ability = relationship(Ability,
|
|||
)
|
||||
Pokemon.forms = relationship(PokemonForm,
|
||||
primaryjoin=Pokemon.id==PokemonForm.pokemon_id,
|
||||
order_by=(PokemonForm.order.asc(), PokemonForm.form_identifier.asc()))
|
||||
order_by=(PokemonForm.order.asc(), PokemonForm.form_identifier.asc()),
|
||||
lazy='joined')
|
||||
Pokemon.default_form = relationship(PokemonForm,
|
||||
primaryjoin=and_(
|
||||
Pokemon.id==PokemonForm.pokemon_id,
|
||||
|
|
Loading…
Reference in a new issue