pyramid_jsonapi.workflow package¶
Subpackages¶
- pyramid_jsonapi.workflow.loop package
- Submodules
- pyramid_jsonapi.workflow.loop.collection_get module
- pyramid_jsonapi.workflow.loop.collection_post module
- pyramid_jsonapi.workflow.loop.item_delete module
- pyramid_jsonapi.workflow.loop.item_get module
- pyramid_jsonapi.workflow.loop.item_patch module
- pyramid_jsonapi.workflow.loop.related_get module
- pyramid_jsonapi.workflow.loop.relationships_delete module
- pyramid_jsonapi.workflow.loop.relationships_get module
- pyramid_jsonapi.workflow.loop.relationships_patch module
- pyramid_jsonapi.workflow.loop.relationships_post module
- Module contents
- Submodules
Module contents¶
- class pyramid_jsonapi.workflow.Rejected(view, rejected=None)[source]¶
Bases:
object
- reject_attributes(identifier, things, reason, *, category='attributes')¶
- reject_relationships(identifier, things, reason, *, category='relationships')¶
- property rejected_dict¶
- class pyramid_jsonapi.workflow.ResultObject(view, object, related=None)[source]¶
Bases:
object
- property included_dict¶
- property str_identifier¶
- property tuple_identifier¶
- class pyramid_jsonapi.workflow.Results(view, objects=None, many=True, count=None, limit=None, is_included=False, is_top=False, not_found_message='Object not found.')[source]¶
Bases:
object
- property included_dict¶
- property meta¶
Bases:
object
- pyramid_jsonapi.workflow.allowed_rel_changes(rel, view, stage, obj_data, perm)[source]¶
Authorise write action on a relationship.
- pyramid_jsonapi.workflow.follow_rel(view, rel_name, include_path=None)[source]¶
True if rel_name should be followed and added.
- pyramid_jsonapi.workflow.get_item(view, item_or_id=None)[source]¶
Wrapper around view.get_item() to allow passing an item or an id.
- pyramid_jsonapi.workflow.get_jsonapi_accepts(request)[source]¶
Return a set of all ‘application/vnd.api’ parts of the accept header.
- pyramid_jsonapi.workflow.rel_patch_to_actions(view, src_id, rel, rel_patch_data)[source]¶
Split a patch to a to_many rel into post and delete. Return a to_one patch.
- pyramid_jsonapi.workflow.sh_alter_document_add_returned_count(doc, view, stage, view_method)[source]¶
Add the returned count to meta.
- pyramid_jsonapi.workflow.sh_alter_document_debug_info(doc, view, stage, view_method)[source]¶
Potentially add some debug information.
- pyramid_jsonapi.workflow.sh_alter_document_self_link(doc, view, stage, view_method)[source]¶
Include a self link unless the method is PATCH.
- pyramid_jsonapi.workflow.sh_alter_request_add_info(request, view, stage, view_method)[source]¶
Add information commonly used in view operations.
- pyramid_jsonapi.workflow.sh_validate_request_common_validity(request, view, stage, view_method)[source]¶
Perform common request validity checks.
- pyramid_jsonapi.workflow.sh_validate_request_headers(request, view, stage, view_method)[source]¶
Check that request headers comply with spec.
- Raises
HTTPUnsupportedMediaType –
HTTPNotAcceptable –
- pyramid_jsonapi.workflow.sh_validate_request_object_exists(request, view, stage, view_method)[source]¶
Make sure that id exists in collection for all urls specifying an id.
- pyramid_jsonapi.workflow.sh_validate_request_valid_json(request, view, stage, view_method)[source]¶
Check that the body of any request is valid JSON.
- Raises
HTTPBadRequest –
- pyramid_jsonapi.workflow.shp_collection_post_alter_request(request, view, stage, view_method)[source]¶
- pyramid_jsonapi.workflow.shp_relationships_delete_alter_request(request, view, stage, view_method)[source]¶
- pyramid_jsonapi.workflow.shp_relationships_patch_alter_request(request, view, stage, view_method)[source]¶