X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/82f8dc6678e16b56c58050f90b73d3d98745191f..fe56b5a6908f4061ce7e69b26d0f988d21ecd30d:/pokedex/lookup.py diff --git a/pokedex/lookup.py b/pokedex/lookup.py index 79ea5b7..d9b46cd 100644 --- a/pokedex/lookup.py +++ b/pokedex/lookup.py @@ -58,6 +58,7 @@ class PokedexLookup(object): for cls in ( tables.Ability, tables.Item, + tables.Location, tables.Move, tables.Pokemon, tables.Type, @@ -142,7 +143,7 @@ class PokedexLookup(object): # especially when e.g. German names are very similar to English names speller_entries = [] for cls in self.indexed_tables.values(): - q = session.query(cls) + q = self.session.query(cls) for row in q.yield_per(5): row_key = dict(table=unicode(cls.__tablename__), @@ -343,15 +344,7 @@ class PokedexLookup(object): query = whoosh.query.Term(u'row_id', name) else: # Not an integer - query = whoosh.query.Term(u'name', name) \ - & whoosh.query.Term(u'forme_name', u'__empty__') - - # If there's a space in the input, this might be a form - if ' ' in name: - form, formless_name = name.split(' ', 1) - form_query = whoosh.query.Term(u'name', formless_name) \ - & whoosh.query.Term(u'forme_name', form) - query = query | form_query + query = whoosh.query.Term(u'name', name) ### Filter by type of object type_terms = []