archive_storage wrapper¶
This module provides frontend API for storing / retreiving DBArchive
from/to the universal object database.
-
storage.archive_storage.
save_archive
(archive)¶ Save archive into database and into proper indexes.
- Attr:
- archive (obj): Instance of the
DBArchive
.
Returns: DBArchive
without data.Return type: obj
Raises: InvalidType
– When the archive is not instance ofDBArchive
.UnindexablePublication
– When there is no index (property) which can be used to index archive in database.
-
storage.archive_storage.
search_archives
(query)¶ Return list of
DBArchive
which match all properties that are set (not None
) using AND operator to all of them.Example
- result = storage_handler.search_publications(
- DBArchive(isbn=”azgabash”)
)
Parameters: query (obj) – DBArchive
with some of the properties set.Returns: List of matching DBArchive
or[]
if no match was found.Return type: list Raises: InvalidType
– When the query is not instance ofDBArchive
.