Permalink
Browse files

Eagerload Pokemon.forms.

This fixes all those spline-pokedex tests that broke when I fixed
Pokémon name display.
  • Loading branch information...
1 parent 7528758 commit cdf052555be147fadfe47263e3483c7f08f2b9d7 @Zhorken Zhorken committed Feb 29, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 pokedex/db/tables.py
@@ -1944,7 +1944,8 @@ class VersionGroupRegion(TableBase):
)
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,

0 comments on commit cdf0525

Please sign in to comment.