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
This commit is contained in:
Andrew Ekstedt 2018-06-26 23:49:40 -07:00
parent 57915f656b
commit ffb0638ef5
1 changed files with 2 additions and 2 deletions

View File

@ -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) \