projects
/
zzz-pokedex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fef9ee8
)
Give abilities separate relations for all/normal/dream Pokémon.
author
Lynn "Zhorken" Vaughan
<zhorken@gmail.com>
Sat, 11 Dec 2010 17:10:08 +0000
(12:10 -0500)
committer
Lynn "Zhorken" Vaughan
<zhorken@gmail.com>
Sat, 11 Dec 2010 17:20:19 +0000
(12:20 -0500)
pokedex/db/tables.py
patch
|
blob
|
history
diff --git
a/pokedex/db/tables.py
b/pokedex/db/tables.py
index
63b2efc
..
c4759e0
100644
(file)
--- a/
pokedex/db/tables.py
+++ b/
pokedex/db/tables.py
@@
-1306,8
+1306,25
@@
Ability.changelog = relation(AbilityChangelog,
Ability.flavor_text = relation(AbilityFlavorText, order_by=AbilityFlavorText.version_group_id, backref='ability')
Ability.foreign_names = relation(AbilityName, backref='ability')
Ability.generation = relation(Generation, backref='abilities')
Ability.flavor_text = relation(AbilityFlavorText, order_by=AbilityFlavorText.version_group_id, backref='ability')
Ability.foreign_names = relation(AbilityName, backref='ability')
Ability.generation = relation(Generation, backref='abilities')
+Ability.all_pokemon = relation(Pokemon,
+ secondary=PokemonAbility.__table__,
+ back_populates='all_abilities',
+)
Ability.pokemon = relation(Pokemon,
secondary=PokemonAbility.__table__,
Ability.pokemon = relation(Pokemon,
secondary=PokemonAbility.__table__,
+ primaryjoin=and_(
+ PokemonAbility.ability_id == Ability.id,
+ PokemonAbility.is_dream == False
+ ),
+ back_populates='abilities',
+)
+Ability.dream_pokemon = relation(Pokemon,
+ secondary=PokemonAbility.__table__,
+ primaryjoin=and_(
+ PokemonAbility.ability_id == Ability.id,
+ PokemonAbility.is_dream == True
+ ),
+ back_populates='dream_ability',
)
AbilityChangelog.changed_in = relation(VersionGroup, backref='ability_changelog')
)
AbilityChangelog.changed_in = relation(VersionGroup, backref='ability_changelog')