Get more data out of openlibrary

This commit is contained in:
Mouse Reeve
2020-03-27 21:28:52 -07:00
parent 5c475e448a
commit 51e7a50b86
5 changed files with 143 additions and 28 deletions

View File

@ -26,6 +26,15 @@ class AbstractConnector(ABC):
return False
return True
def has_attr(self, obj, key):
''' helper function to check if a model object has a key '''
try:
return hasattr(obj, key)
except ValueError:
return False
@abstractmethod
def search(self, query):
''' free text search '''