diff --git a/pokedex/data/csv/stat_hint_names.csv b/pokedex/data/csv/characteristic_text.csv similarity index 93% rename from pokedex/data/csv/stat_hint_names.csv rename to pokedex/data/csv/characteristic_text.csv index 0087f27..dcdef66 100644 --- a/pokedex/data/csv/stat_hint_names.csv +++ b/pokedex/data/csv/characteristic_text.csv @@ -1,4 +1,4 @@ -stat_hint_id,local_language_id,message +characteristic_id,local_language_id,message 1,9,Loves to eat 2,9,Proud of its power 3,9,Sturdy body diff --git a/pokedex/data/csv/stat_hints.csv b/pokedex/data/csv/characteristics.csv similarity index 100% rename from pokedex/data/csv/stat_hints.csv rename to pokedex/data/csv/characteristics.csv diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 138e22d..447b6a5 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -226,6 +226,24 @@ class BerryFlavor(TableBase): flavor = Column(Integer, nullable=False, doc=u"The level of the flavor in the berry") +class Characteristic(TableBase): + u"""Flavor text hinting at genes that appears in a Pokémon's summary.""" + __tablename__ = 'characteristics' + __singlename__ = 'characteristic' + id = Column(Integer, primary_key=True, nullable=False, + doc=u"A numeric ID") + stat_id = Column(Integer, ForeignKey('stats.id'), nullable=False, + doc=u"ID of the stat with the highest gene") + gene_mod_5 = Column(Integer, nullable=False, index=True, + doc=u"Value of the highest gene modulo 5") + +create_translation_table('characteristic_text', Characteristic, 'text', + relation_lazy='joined', + message = Column(Unicode(79), nullable=False, index=True, + doc=u"The text displayed", + info=dict(official=True, format='plaintext')), +) + class ConquestEpisode(TableBase): u"""An episode from Pokémon Conquest: one of a bunch of mini-stories featuring a particular warrior. @@ -2079,26 +2097,6 @@ create_translation_table('stat_names', Stat, 'names', info=dict(format='plaintext', official=True)), ) -class StatHint(TableBase): - u"""Flavor text for genes that appears in a Pokémon's summary. Sometimes - called "characteristics". - """ - __tablename__ = 'stat_hints' - __singlename__ = 'stat_hint' - id = Column(Integer, primary_key=True, nullable=False, - doc=u"A numeric ID") - stat_id = Column(Integer, ForeignKey('stats.id'), nullable=False, - doc=u"ID of the highest stat") - gene_mod_5 = Column(Integer, nullable=False, index=True, - doc=u"Value of the highest stat modulo 5") - -create_translation_table('stat_hint_names', StatHint, 'names', - relation_lazy='joined', - message = Column(Unicode(79), nullable=False, index=True, - doc=u"The text displayed", - info=dict(official=True, format='plaintext')), -) - class SuperContestCombo(TableBase): u"""Combo of two moves in a Super Contest.""" __tablename__ = 'super_contest_combos' @@ -2254,6 +2252,11 @@ Berry.natural_gift_type = relationship(Type, innerjoin=True) BerryFlavor.contest_type = relationship(ContestType, innerjoin=True) +Characteristic.stat = relationship(Stat, + innerjoin=True, + backref='characteristics') + + ConquestEpisode.warriors = relationship(ConquestWarrior, secondary=ConquestEpisodeWarrior.__table__, innerjoin=True, @@ -2830,10 +2833,6 @@ Region.version_groups = relationship(VersionGroup, Stat.damage_class = relationship(MoveDamageClass, backref='stats') -StatHint.stat = relationship(Stat, - innerjoin=True, - backref='hints') - SuperContestCombo.first = relationship(Move, primaryjoin=SuperContestCombo.first_move_id==Move.id,