Eagerload Pokemon.forms.

This fixes all those spline-pokedex tests that broke when I fixed
Pokémon name display.
This commit is contained in:
Lynn "Zhorken" Vaughan 2012-02-28 19:02:01 -05:00
parent 75287587a2
commit cdf052555b

View file

@ -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,