mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Use VersionGroup.order in a bunch of relationships
This commit is contained in:
parent
1134415e13
commit
73cf9c036c
1 changed files with 5 additions and 3 deletions
|
@ -1879,7 +1879,7 @@ Pokedex.region = relationship(Region,
|
||||||
backref='pokedexes')
|
backref='pokedexes')
|
||||||
Pokedex.version_groups = relationship(VersionGroup,
|
Pokedex.version_groups = relationship(VersionGroup,
|
||||||
innerjoin=True,
|
innerjoin=True,
|
||||||
order_by=VersionGroup.id.asc(),
|
order_by=VersionGroup.order.asc(),
|
||||||
backref='pokedex')
|
backref='pokedex')
|
||||||
|
|
||||||
|
|
||||||
|
@ -2060,7 +2060,9 @@ Region.generation = relationship(Generation, uselist=False)
|
||||||
Region.version_group_regions = relationship(VersionGroupRegion,
|
Region.version_group_regions = relationship(VersionGroupRegion,
|
||||||
order_by=VersionGroupRegion.version_group_id.asc(),
|
order_by=VersionGroupRegion.version_group_id.asc(),
|
||||||
backref='region')
|
backref='region')
|
||||||
Region.version_groups = association_proxy('version_group_regions', 'version_group')
|
Region.version_groups = relationship(VersionGroup,
|
||||||
|
secondary=VersionGroupRegion.__table__,
|
||||||
|
order_by=VersionGroup.order)
|
||||||
|
|
||||||
|
|
||||||
Stat.damage_class = relationship(MoveDamageClass,
|
Stat.damage_class = relationship(MoveDamageClass,
|
||||||
|
@ -2103,7 +2105,7 @@ VersionGroup.versions = relationship(Version,
|
||||||
backref=backref('version_group', lazy='joined'))
|
backref=backref('version_group', lazy='joined'))
|
||||||
VersionGroup.generation = relationship(Generation,
|
VersionGroup.generation = relationship(Generation,
|
||||||
innerjoin=True, lazy='joined',
|
innerjoin=True, lazy='joined',
|
||||||
backref='version_groups')
|
backref=backref('version_groups', order_by=VersionGroup.order))
|
||||||
VersionGroup.version_group_regions = relationship(VersionGroupRegion,
|
VersionGroup.version_group_regions = relationship(VersionGroupRegion,
|
||||||
backref='version_group')
|
backref='version_group')
|
||||||
VersionGroup.regions = association_proxy('version_group_regions', 'region')
|
VersionGroup.regions = association_proxy('version_group_regions', 'region')
|
||||||
|
|
Loading…
Reference in a new issue