web_tools submodule¶
Functions shared by the server script and also by the backend.
-
exception
storage.web_tools.
PrivatePublicationError
¶ Bases:
exceptions.UserWarning
Indication that publication is private.
-
storage.web_tools.
compose_path
(pub, uuid_url=False)¶ Compose absolute path for given pub.
Parameters: - pub (obj) –
DBPublication
instance. - 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: - pub (obj) –
Tree
instance. - issn (bool, default False) – Compose URL using ISSN.
Returns: Absolute path of the tree, without server’s address and protocol.
Return type: - pub (obj) –
-
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) –
DBPublication
instance. - 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) –