X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/28e6b68b0aa5e9488a20c8ec2666c2b8cafebc76..3ee559684d0065e51a1ff8c99f2668b05a586136:/pokedex/db/tables.py?ds=sidebyside diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 63b2efc..9eb9dd9 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -363,6 +363,8 @@ class Item(TableBase): info=dict(description=u"Power of the move Fling when used with this item.")) fling_effect_id = Column(Integer, ForeignKey('item_fling_effects.id'), nullable=True, info=dict(description=u"ID of the fling-effect of the move Fling when used with this item. Note that these are different from move effects.")) + short_effect = Column(Unicode(256), nullable=False, + info=dict(description="A short summary of the effect", format='plaintext')) effect = Column(markdown.MarkdownColumn(5120), nullable=False, info=dict(description=u"Detailed English description of the item's effect.", format='markdown')) @@ -1306,8 +1308,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.all_pokemon = relation(Pokemon, + secondary=PokemonAbility.__table__, + back_populates='all_abilities', +) 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') @@ -1562,7 +1581,7 @@ PokemonMove.machine = relation(Machine, backref='pokemon_moves', PokemonMove.move = relation(Move, backref='pokemon_moves') PokemonMove.method = relation(PokemonMoveMethod) -PokemonName.language = relation(Language) +PokemonName.language = relation(Language, lazy='joined') PokemonStat.stat = relation(Stat)