mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Added more table relations, for spline-pokedex Pokemon page.
This commit is contained in:
parent
b9b1b3ddcd
commit
35ac91dc48
1 changed files with 22 additions and 0 deletions
|
@ -181,4 +181,26 @@ class Version(TableBase):
|
|||
|
||||
|
||||
### Relations down here, to avoid ordering problems
|
||||
Pokemon.abilities = relation(Ability, secondary=PokemonAbility.__table__,
|
||||
order_by=PokemonAbility.slot,
|
||||
backref='pokemon')
|
||||
Pokemon.dex_numbers = relation(PokemonDexNumber, backref='pokemon')
|
||||
Pokemon.evolution_chain = relation(EvolutionChain, backref='pokemon')
|
||||
Pokemon.foreign_names = relation(PokemonName, backref='pokemon')
|
||||
Pokemon.stats = relation(PokemonStat, backref='pokemon')
|
||||
Pokemon.types = relation(Type, secondary=PokemonType.__table__)
|
||||
|
||||
PokemonDexNumber.generation = relation(Generation)
|
||||
|
||||
PokemonName.language = relation(Language)
|
||||
|
||||
PokemonStat.stat = relation(Stat)
|
||||
|
||||
Type.damage_efficacies = relation(TypeEfficacy,
|
||||
primaryjoin=Type.id
|
||||
==TypeEfficacy.damage_type_id,
|
||||
backref='damage_type')
|
||||
Type.target_efficacies = relation(TypeEfficacy,
|
||||
primaryjoin=Type.id
|
||||
==TypeEfficacy.target_type_id,
|
||||
backref='target_type')
|
||||
|
|
Loading…
Reference in a new issue