mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Lookup now respects "ability" as a lookup type.
This commit is contained in:
parent
97f96a5695
commit
9ca0f486f6
1 changed files with 9 additions and 7 deletions
|
@ -290,13 +290,15 @@ class PokedexLookup(object):
|
||||||
|
|
||||||
Returns None for a bogus name.
|
Returns None for a bogus name.
|
||||||
"""
|
"""
|
||||||
|
# Table object
|
||||||
if hasattr(name, '__tablename__'):
|
if hasattr(name, '__tablename__'):
|
||||||
return getattr(name, '__tablename__')
|
return getattr(name, '__tablename__')
|
||||||
elif name in self.indexed_tables:
|
|
||||||
return name
|
# Table name
|
||||||
elif name + 's' in self.indexed_tables:
|
for table in self.indexed_tables.values():
|
||||||
return name + 's'
|
if name in (table.__tablename__, table.__singlename__):
|
||||||
else:
|
return table.__tablename__
|
||||||
|
|
||||||
# Bogus. Be nice and return dummy
|
# Bogus. Be nice and return dummy
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue