From: Eevee Date: Thu, 2 Sep 2010 04:52:44 +0000 (-0700) Subject: Add a Nature.is_neutral helper property. X-Git-Tag: veekun-promotions/2010091201~4 X-Git-Url: http://git.veekun.com/zzz-pokedex.git/commitdiff_plain/65b89cfc18745c569c81058754cb85c709426b2f?ds=sidebyside Add a Nature.is_neutral helper property. --- diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 4271efd..80c191a 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -398,6 +398,13 @@ class Nature(TableBase): 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)