From ffb0638ef5c86569a779a15c6478ee31750ba1bc Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Tue, 26 Jun 2018 23:49:40 -0700 Subject: [PATCH] Unbreak SaveFilePokemon slightly The schema has changed a little in the past, uh, seven years. Works well enough to parse and display one of my pokemon in the gts plugin. Updates veekun/spline-pokedex#72 --- pokedex/struct/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokedex/struct/__init__.py b/pokedex/struct/__init__.py index b6a3e73..950dce8 100644 --- a/pokedex/struct/__init__.py +++ b/pokedex/struct/__init__.py @@ -107,11 +107,11 @@ class SaveFilePokemon(object): self._pokemon = session.query(tables.Pokemon).get(st.national_id) self._pokemon_form = session.query(tables.PokemonForm) \ .with_parent(self._pokemon) \ - .filter_by(name=st.alternate_form) \ + .filter_by(form_identifier=st.alternate_form) \ .one() self._ability = self._session.query(tables.Ability).get(st.ability_id) - growth_rate = self._pokemon.evolution_chain.growth_rate + growth_rate = self._pokemon.species.growth_rate self._experience_rung = session.query(tables.Experience) \ .filter(tables.Experience.growth_rate == growth_rate) \ .filter(tables.Experience.experience <= st.exp) \