projects
/
zzz-pokedex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a46d340
)
Added more table relations, for spline-pokedex Pokemon page.
author
Eevee
<git@veekun.com>
Mon, 2 Mar 2009 03:40:02 +0000
(19:40 -0800)
committer
Eevee
<git@veekun.com>
Mon, 2 Mar 2009 03:40:02 +0000
(19:40 -0800)
pokedex/db/tables.py
patch
|
blob
|
history
diff --git
a/pokedex/db/tables.py
b/pokedex/db/tables.py
index
e738c0d
..
7bf7822
100644
(file)
--- a/
pokedex/db/tables.py
+++ b/
pokedex/db/tables.py
@@
-181,4
+181,26
@@
class Version(TableBase):
### Relations down here, to avoid ordering problems
### 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__)
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')