apicrud.controllers.grant¶
grant controller
created 27-may-2019 by richb@instantlinux.net
Classes
-
class
apicrud.controllers.grant.
GrantController
¶ -
static
create
(body)¶ Controller for POST endpoints. This method assigns a new object ID, sets the _created_ timestamp, evaluates user’s permissions, adds a default category_id if the model has this attribute, and inserts a row to the back-end database.
- Parameters
body (dict) – resource fields as defined by openapi.yaml schema
id_prefix (str) – generated objects will be assigned a random 10- to 16-character ID; you can set a unique prefix if desired
limit_related (dict) – limits on number of related records, keyed by relationship name
- Returns
first element is a dict with the id, second element is response code (201 on success)
- Return type
tuple
-
static
find
(**kwargs)¶ Find multiple grants
- Parameters
kwargs – as defined in openapi.yaml
-
static
get
(id)¶ Get one grant
- Parameters
id (str) – Database or hybrid grant ID
-
static
update
(id, body)¶ If the id has a hybrid uid:grant syntax, invoke create instead; otherwise it’s a standard update
- Parameters
id (str) – Database or hybrid grant ID
body (dict) – resource fields as defined by openapi.yaml schema
-
static