EvolutionChain.growth_rate = relation(GrowthRate, backref='evolution_chains')
EvolutionChain.baby_trigger_item = relation(Item, backref='evolution_chains')
+EvolutionChain.pokemon = relation(Pokemon, order_by=Pokemon.order, back_populates='evolution_chain')
Experience.growth_rate = relation(GrowthRate, backref='experience_table')
Pokemon.dex_numbers = relation(PokemonDexNumber, order_by=PokemonDexNumber.pokedex_id.asc(), backref='pokemon')
Pokemon.egg_groups = relation(EggGroup, secondary=PokemonEggGroup.__table__,
order_by=PokemonEggGroup.egg_group_id,
- backref='pokemon')
-Pokemon.evolution_chain = relation(EvolutionChain, backref='pokemon')
+ backref=backref('pokemon', order_by=Pokemon.order))
+Pokemon.evolution_chain = relation(EvolutionChain, back_populates='pokemon')
Pokemon.child_pokemon = relation(Pokemon,
primaryjoin=Pokemon.id==PokemonEvolution.from_pokemon_id,
secondary=PokemonEvolution.__table__,
Pokemon.generation = relation(Generation, backref='pokemon')
Pokemon.shape = relation(PokemonShape, 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(), backref='pokemon')
+Pokemon.types = relation(Type, secondary=PokemonType.__table__,
+ order_by=PokemonType.slot.asc(),
+ back_populates='pokemon')
PokemonDexNumber.pokedex = relation(Pokedex)
Type.generation = relation(Generation, backref='types')
Type.damage_class = relation(MoveDamageClass, backref='types')
Type.foreign_names = relation(TypeName, backref='type')
+Type.pokemon = relation(Pokemon, secondary=PokemonType.__table__,
+ order_by=Pokemon.order,
+ back_populates='types')
TypeName.language = relation(Language)