From cdf052555be147fadfe47263e3483c7f08f2b9d7 Mon Sep 17 00:00:00 2001
From: "Lynn \"Zhorken\" Vaughan" <zhorken@gmail.com>
Date: Tue, 28 Feb 2012 19:02:01 -0500
Subject: [PATCH] Eagerload Pokemon.forms.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This fixes all those spline-pokedex tests that broke when I fixed
Pokémon name display.
---
 pokedex/db/tables.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py
index 334c96d..e884986 100644
--- a/pokedex/db/tables.py
+++ b/pokedex/db/tables.py
@@ -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,