From 0fcdb6bcc9051c4d9f76ccadc589f90a520fc6d5 Mon Sep 17 00:00:00 2001 From: Eevee Date: Wed, 1 Sep 2010 21:52:44 -0700 Subject: [PATCH] Add a Nature.is_neutral helper property. --- pokedex/db/tables.py | 7 +++++++ 1 file changed, 7 insertions(+) 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)