-PokemonEvolution.from_pokemon = relation(Pokemon,
- primaryjoin=PokemonEvolution.from_pokemon_id==Pokemon.id,
- innerjoin=True,
- backref='child_evolutions')
-PokemonEvolution.to_pokemon = relation(Pokemon,
- primaryjoin=PokemonEvolution.to_pokemon_id==Pokemon.id,
- innerjoin=True,
- backref=backref('parent_evolution', uselist=False))
-PokemonEvolution.child_evolutions = relation(PokemonEvolution,
- primaryjoin=PokemonEvolution.from_pokemon_id==PokemonEvolution.to_pokemon_id,
- foreign_keys=[PokemonEvolution.to_pokemon_id],
- backref=backref('parent_evolution',
- remote_side=[PokemonEvolution.from_pokemon_id],
- uselist=False))