order.py¶
Functions and request handlers related to orders.
Special permissions are required to access orders:
If you have permission
DATA_EDIT
you have CRUD permissions to your own orders.If you have permission
DATA_MANAGEMENT
you have CRUD permissions to any orders.
- order.add_dataset(identifier: str)[source]¶
Add a dataset to the given order.
- Parameters
identifier (str) – The order to add the dataset to.
- order.add_order()[source]¶
Add an order.
- Returns
Json structure with
_id
of the added order.- Return type
flask.Response
- order.delete_order(identifier: str)[source]¶
Delete the order with the given identifier.
- Returns
Status code
- Return type
flask.Response
- order.get_order(identifier)[source]¶
Retrieve the order with the provided uuid.
order['datasets']
is returned as[{_id, title}, ...]
.- Parameters
identifier (str) – Uuid for the wanted order.
- Returns
JSON structure for the order.
- Return type
flask.Response
- order.get_order_logs(identifier)[source]¶
List changes to the dataset.
Logs will be sorted chronologically.
The
data
in each log will be trimmed to only show the changed fields.- Parameters
identifier (str) – Uuid for the wanted order.
- Returns
Json structure for the logs.
- Return type
flask.Response
- order.list_orders()[source]¶
List all orders visible to the current user.
- Returns
JSON structure with a list of orders.
- Return type
flask.Response
- order.prepare()[source]¶
All order request require
DATA_EDIT
.Make sure that the user is logged in and has the required permission.