web_tools submodule¶
Functions shared by the server script and also by the backend.
-
exception
storage.web_tools.PrivatePublicationError¶ Bases:
exceptions.UserWarningIndication that publication is private.
-
storage.web_tools.compose_path(pub, uuid_url=False)¶ Compose absolute path for given pub.
Parameters: - pub (obj) –
DBPublicationinstance. - uuid_url (bool, default False) – Compose URL using UUID.
Returns: Absolute url-path of the publication, without server’s address and protocol.
Return type: Raises: PrivatePublicationError– When the pub is private publication.- pub (obj) –
-
storage.web_tools.compose_tree_path(tree, issn=False)¶ Compose absolute path for given tree.
Parameters: Returns: Absolute path of the tree, without server’s address and protocol.
Return type:
-
storage.web_tools.compose_full_url(pub, uuid_url=False)¶ Compose full url for given pub, with protocol, server’s address and port.
Parameters: - pub (obj) –
DBPublicationinstance. - uuid_url (bool, default False) – Compose URL using UUID.
Returns: Absolute url of the publication.
Return type: Raises: PrivatePublicationError– When the pub is private publication.- pub (obj) –