From 43b0530983a2b42e81dfc2f2166796ec08455773 Mon Sep 17 00:00:00 2001 From: "Lynn \"Zhorken\" Vaughan" Date: Mon, 31 Jan 2011 17:02:34 -0500 Subject: [PATCH 1/1] =?utf8?q?Order=20Ability's=20Pok=C3=A9mon=20relations?= =?utf8?q?=20by=20Pokemon.order.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- pokedex/db/tables.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index e4dd61b..b5f1d7d 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -1318,6 +1318,7 @@ Ability.foreign_names = relation(AbilityName, backref='ability') Ability.generation = relation(Generation, backref='abilities') Ability.all_pokemon = relation(Pokemon, secondary=PokemonAbility.__table__, + order_by=Pokemon.order, back_populates='all_abilities', ) Ability.pokemon = relation(Pokemon, @@ -1326,6 +1327,7 @@ Ability.pokemon = relation(Pokemon, PokemonAbility.ability_id == Ability.id, PokemonAbility.is_dream == False ), + order_by=Pokemon.order, back_populates='abilities', ) Ability.dream_pokemon = relation(Pokemon, @@ -1334,6 +1336,7 @@ Ability.dream_pokemon = relation(Pokemon, PokemonAbility.ability_id == Ability.id, PokemonAbility.is_dream == True ), + order_by=Pokemon.order, back_populates='dream_ability', ) -- 2.7.4