mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Make Type.moves a proper relation with an order_by.
This commit is contained in:
parent
6c286ffa6f
commit
04ec336654
1 changed files with 2 additions and 1 deletions
|
@ -1434,7 +1434,7 @@ Move.super_contest_effect = relation(SuperContestEffect, backref='moves')
|
||||||
Move.super_contest_combo_next = association_proxy('super_contest_combo_first', 'second')
|
Move.super_contest_combo_next = association_proxy('super_contest_combo_first', 'second')
|
||||||
Move.super_contest_combo_prev = association_proxy('super_contest_combo_second', 'first')
|
Move.super_contest_combo_prev = association_proxy('super_contest_combo_second', 'first')
|
||||||
Move.target = relation(MoveTarget, backref='moves')
|
Move.target = relation(MoveTarget, backref='moves')
|
||||||
Move.type = relation(Type, backref='moves')
|
Move.type = relation(Type, back_populates='moves')
|
||||||
|
|
||||||
Move.effect = markdown.MoveEffectProperty('effect')
|
Move.effect = markdown.MoveEffectProperty('effect')
|
||||||
Move.short_effect = markdown.MoveEffectProperty('short_effect')
|
Move.short_effect = markdown.MoveEffectProperty('short_effect')
|
||||||
|
@ -1628,6 +1628,7 @@ Type.foreign_names = relation(TypeName, backref='type')
|
||||||
Type.pokemon = relation(Pokemon, secondary=PokemonType.__table__,
|
Type.pokemon = relation(Pokemon, secondary=PokemonType.__table__,
|
||||||
order_by=Pokemon.order,
|
order_by=Pokemon.order,
|
||||||
back_populates='types')
|
back_populates='types')
|
||||||
|
Type.moves = relation(Move, back_populates='type', order_by=Move.name)
|
||||||
|
|
||||||
TypeName.language = relation(Language)
|
TypeName.language = relation(Language)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue