+ super_contest_effect_id = Column(Integer, ForeignKey('super_contest_effects.id'), nullable=True)
+
+class Nature(TableBase):
+ __tablename__ = 'natures'
+ __singlename__ = 'nature'
+ id = Column(Integer, primary_key=True, nullable=False)
+ name = Column(Unicode(8), nullable=False)
+ decreased_stat_id = Column(Integer, ForeignKey('stats.id'), nullable=False)
+ increased_stat_id = Column(Integer, ForeignKey('stats.id'), nullable=False)
+ hates_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False)
+ likes_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False)
+
+ @property
+ def is_neutral(self):
+ u"""Returns True iff this nature doesn't alter a Pokémon's stats,
+ bestow taste preferences, etc.
+ """
+ return self.increased_stat_id == self.decreased_stat_id
+
+class NatureBattleStylePreference(TableBase):
+ __tablename__ = 'nature_battle_style_preferences'
+ nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False)
+ move_battle_style_id = Column(Integer, ForeignKey('move_battle_styles.id'), primary_key=True, nullable=False)
+ low_hp_preference = Column(Integer, nullable=False)
+ high_hp_preference = Column(Integer, nullable=False)
+
+class NatureName(TableBase):
+ __tablename__ = 'nature_names'
+ nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False, autoincrement=False)
+ language_id = Column(Integer, ForeignKey('languages.id'), primary_key=True, nullable=False, autoincrement=False)
+ name = Column(Unicode(8), nullable=False)
+
+class NaturePokeathlonStat(TableBase):
+ __tablename__ = 'nature_pokeathlon_stats'
+ nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False)
+ pokeathlon_stat_id = Column(Integer, ForeignKey('pokeathlon_stats.id'), primary_key=True, nullable=False)
+ max_change = Column(Integer, nullable=False)
+
+class PokeathlonStat(TableBase):
+ __tablename__ = 'pokeathlon_stats'
+ id = Column(Integer, primary_key=True, nullable=False)
+ name = Column(Unicode(8), nullable=False)
+
+class Pokedex(TableBase):
+ __tablename__ = 'pokedexes'
+ id = Column(Integer, primary_key=True, nullable=False)
+ region_id = Column(Integer, ForeignKey('regions.id'), nullable=True)
+ name = Column(Unicode(16), nullable=False)
+ description = Column(Unicode(512))
+
+class PokedexVersionGroup(TableBase):
+ __tablename__ = 'pokedex_version_groups'
+ pokedex_id = Column(Integer, ForeignKey('pokedexes.id'), primary_key=True, nullable=False, autoincrement=False)
+ version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False)