mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Add innerjoin=True and add/remove lazy='joined' on a bunch of relationships.
This commit is contained in:
parent
f11058dd2f
commit
ac3aee12ee
1 changed files with 11 additions and 16 deletions
|
@ -2055,10 +2055,10 @@ ConquestMoveData.move = relationship(Move,
|
||||||
innerjoin=True, lazy='joined',
|
innerjoin=True, lazy='joined',
|
||||||
backref=backref('conquest_data', uselist=False))
|
backref=backref('conquest_data', uselist=False))
|
||||||
ConquestMoveData.move_effect = relationship(ConquestMoveEffect,
|
ConquestMoveData.move_effect = relationship(ConquestMoveEffect,
|
||||||
innerjoin=True,
|
innerjoin=True, lazy='joined',
|
||||||
backref='move_data')
|
backref='move_data')
|
||||||
ConquestMoveData.range = relationship(ConquestMoveRange,
|
ConquestMoveData.range = relationship(ConquestMoveRange,
|
||||||
innerjoin=True,
|
innerjoin=True, lazy='joined',
|
||||||
backref='move_data')
|
backref='move_data')
|
||||||
|
|
||||||
ConquestMoveData.effect = markdown.MoveEffectProperty('effect')
|
ConquestMoveData.effect = markdown.MoveEffectProperty('effect')
|
||||||
|
@ -2078,9 +2078,11 @@ ConquestPokemonEvolution.stat = relationship(ConquestStat,
|
||||||
|
|
||||||
ConquestPokemonStat.pokemon = relationship(PokemonSpecies,
|
ConquestPokemonStat.pokemon = relationship(PokemonSpecies,
|
||||||
uselist=False,
|
uselist=False,
|
||||||
|
innerjoin=True, lazy='joined',
|
||||||
backref='conquest_stats')
|
backref='conquest_stats')
|
||||||
ConquestPokemonStat.stat = relationship(ConquestStat,
|
ConquestPokemonStat.stat = relationship(ConquestStat,
|
||||||
uselist=False,
|
uselist=False,
|
||||||
|
innerjoin=True, lazy='joined',
|
||||||
backref='pokemon_stats')
|
backref='pokemon_stats')
|
||||||
|
|
||||||
ConquestWarrior.archetype = relationship(ConquestWarriorArchetype,
|
ConquestWarrior.archetype = relationship(ConquestWarriorArchetype,
|
||||||
|
@ -2088,12 +2090,12 @@ ConquestWarrior.archetype = relationship(ConquestWarriorArchetype,
|
||||||
backref=backref('warriors'))
|
backref=backref('warriors'))
|
||||||
ConquestWarrior.ranks = relationship(ConquestWarriorRank,
|
ConquestWarrior.ranks = relationship(ConquestWarriorRank,
|
||||||
order_by=ConquestWarriorRank.rank,
|
order_by=ConquestWarriorRank.rank,
|
||||||
innerjoin=True, lazy='joined',
|
innerjoin=True,
|
||||||
backref=backref('warrior', uselist=False))
|
backref=backref('warrior', uselist=False))
|
||||||
ConquestWarrior.types = relationship(Type,
|
ConquestWarrior.types = relationship(Type,
|
||||||
secondary=ConquestWarriorSpecialty.__table__,
|
secondary=ConquestWarriorSpecialty.__table__,
|
||||||
order_by=ConquestWarriorSpecialty.slot,
|
order_by=ConquestWarriorSpecialty.slot,
|
||||||
innerjoin=True, lazy='joined',
|
innerjoin=True,
|
||||||
backref='conquest_warriors')
|
backref='conquest_warriors')
|
||||||
|
|
||||||
ConquestWarriorRank.skill = relationship(ConquestWarriorSkill,
|
ConquestWarriorRank.skill = relationship(ConquestWarriorSkill,
|
||||||
|
@ -2101,9 +2103,9 @@ ConquestWarriorRank.skill = relationship(ConquestWarriorSkill,
|
||||||
innerjoin=True, lazy='joined',
|
innerjoin=True, lazy='joined',
|
||||||
backref=backref('warrior_ranks', order_by=ConquestWarriorRank.id))
|
backref=backref('warrior_ranks', order_by=ConquestWarriorRank.id))
|
||||||
ConquestWarriorRank.stats = relationship(ConquestWarriorRankStatMap,
|
ConquestWarriorRank.stats = relationship(ConquestWarriorRankStatMap,
|
||||||
innerjoin=True, lazy='joined',
|
innerjoin=True,
|
||||||
order_by = ConquestWarriorRankStatMap.warrior_stat_id,
|
order_by=ConquestWarriorRankStatMap.warrior_stat_id,
|
||||||
backref=backref('warrior_rank', uselist=False, innerjoin=True))
|
backref=backref('warrior_rank', uselist=False, innerjoin=True, lazy='joined'))
|
||||||
|
|
||||||
ConquestWarriorRankStatMap.stat = relationship(ConquestWarriorStat,
|
ConquestWarriorRankStatMap.stat = relationship(ConquestWarriorStat,
|
||||||
innerjoin=True, lazy='joined',
|
innerjoin=True, lazy='joined',
|
||||||
|
@ -2272,7 +2274,7 @@ Move.target = relationship(MoveTarget,
|
||||||
innerjoin=True,
|
innerjoin=True,
|
||||||
backref='moves')
|
backref='moves')
|
||||||
Move.type = relationship(Type,
|
Move.type = relationship(Type,
|
||||||
innerjoin=True,
|
innerjoin=True, lazy='joined',
|
||||||
backref='moves')
|
backref='moves')
|
||||||
|
|
||||||
Move.effect = markdown.MoveEffectProperty('effect')
|
Move.effect = markdown.MoveEffectProperty('effect')
|
||||||
|
@ -2558,14 +2560,7 @@ PokemonSpecies.conquest_move = relationship(Move,
|
||||||
backref=backref('conquest_pokemon', order_by=PokemonSpecies.conquest_order))
|
backref=backref('conquest_pokemon', order_by=PokemonSpecies.conquest_order))
|
||||||
PokemonSpecies.conquest_evolution = relationship(ConquestPokemonEvolution,
|
PokemonSpecies.conquest_evolution = relationship(ConquestPokemonEvolution,
|
||||||
uselist=False,
|
uselist=False,
|
||||||
backref=backref('conquest_evolved_species', innerjoin=True, lazy='joined'))
|
backref=backref('evolved_species', innerjoin=True, lazy='joined', uselist=False))
|
||||||
#PokemonSpecies.conquest_main_stats = relationship(ConquestPokemonStat,
|
|
||||||
# primaryjoin=and_(PokemonSpecies.id == ConquestPokemonStat.pokemon_species_id,
|
|
||||||
# ConquestPokemonStat.stat.is_base == True))
|
|
||||||
#PokemonSpecies.conquest_range = relationship(ConquestPokemonStat,
|
|
||||||
# primaryjoin=and_(PokemonSpecies.id == ConquestPokemonStat.pokemon_species_id,
|
|
||||||
# ConquestPokemonStat.stat.identifier == 'range'),
|
|
||||||
# uselist=False)
|
|
||||||
|
|
||||||
PokemonSpeciesFlavorText.version = relationship(Version, innerjoin=True, lazy='joined')
|
PokemonSpeciesFlavorText.version = relationship(Version, innerjoin=True, lazy='joined')
|
||||||
PokemonSpeciesFlavorText.language = relationship(Language, innerjoin=True, lazy='joined')
|
PokemonSpeciesFlavorText.language = relationship(Language, innerjoin=True, lazy='joined')
|
||||||
|
|
Loading…
Reference in a new issue