publication_storage wrapper¶
This module provides frontend API for storing / retreiving DBPublication from/to the universal object database.
-
storage.publication_storage.save_publication(pub)¶ Save pub into database and into proper indexes.
- Attr:
- pub (obj): Instance of the
DBPublication.
Returns: DBPublicationwithout data.Return type: obj
Raises: InvalidType– When the pub is not instance ofDBPublication.UnindexablePublication– When there is no index (property) which can be used to index pub in database.
-
storage.publication_storage.search_pubs_by_uuid(uuid)¶ Search publications by uuid.
Parameters: uuid (str) – UUID of publication. Returns: List of matching DBPublicationor[]if no match was found.Return type: list
-
storage.publication_storage.search_publications(query)¶ Return list of
DBPublicationwhich match all properties that are set (not None) using AND operator to all of them.Example
- result = storage_handler.search_publications(
- DBPublication(isbn=”azgabash”)
)
Parameters: query (obj) – DBPublicationwith some of the properties set.Returns: List of matching DBPublicationor[]if no match was found.Return type: list Raises: InvalidType– When the query is not instance ofDBPublication.