Order Pokemon.stats by stat id. #366
authorZhorken <zhorken@gmail.com>
Mon, 27 Sep 2010 06:59:48 +0000 (02:59 -0400)
committerZhorken <zhorken@gmail.com>
Mon, 27 Sep 2010 06:59:48 +0000 (02:59 -0400)
pokedex/db/tables.py

index 633d845..31b9445 100644 (file)
@@ -893,7 +893,7 @@ Pokemon.habitat = association_proxy('pokemon_habitat', 'name')
 Pokemon.items = relation(PokemonItem, backref='pokemon')
 Pokemon.generation = relation(Generation, backref='pokemon')
 Pokemon.shape = relation(PokemonShape, backref='pokemon')
-Pokemon.stats = relation(PokemonStat, backref='pokemon')
+Pokemon.stats = relation(PokemonStat, backref='pokemon', order_by=PokemonStat.stat_id.asc())
 Pokemon.types = relation(Type, secondary=PokemonType.__table__, order_by=PokemonType.slot.asc())
 
 PokemonDexNumber.pokedex = relation(Pokedex)