Lookup now respects "ability" as a lookup type.

This commit is contained in:
Eevee 2010-04-30 00:22:03 -07:00
parent 97f96a5695
commit 9ca0f486f6

View file

@ -290,13 +290,15 @@ class PokedexLookup(object):
Returns None for a bogus name.
"""
# Table object
if hasattr(name, '__tablename__'):
return getattr(name, '__tablename__')
elif name in self.indexed_tables:
return name
elif name + 's' in self.indexed_tables:
return name + 's'
else:
# Table name
for table in self.indexed_tables.values():
if name in (table.__tablename__, table.__singlename__):
return table.__tablename__
# Bogus. Be nice and return dummy
return None