pyramid_jsonapi.endpoints module¶
Classes to store and manipulate endpoints and routes.
- class pyramid_jsonapi.endpoints.EndpointData(api)[source]¶
Bases:
object
Class to hold endpoint data and utility methods.
- Parameters
api – A PyramidJSONAPI object.
- add_routes_views(view)[source]¶
Generate routes and views from the endpoints data object.
- Parameters
view – A view_class to associate routes and views with.
- find_all_keys(name, ep_type, method)[source]¶
Generator to fetch all the instances of a particular key in part of the tree.
- Parameters
ep_type – per-endpoint - e.g. collection, item etc.
method – http method
Returns – Yields the value of each matching key.
- get_function_name(view, http_method, route_pattern)[source]¶
Find the name of the function which handles the given route and method.
- property http_methods¶
- property http_to_view_methods¶
- class pyramid_jsonapi.endpoints.RoutePatternConstructor(api)[source]¶
Bases:
object
Construct pyramid_jsonapi route patterns.
- create_pattern(type_prefix, endpoint_name, *components, base='/', rstrip=True)[source]¶
Generate a pattern from a type_prefix, endpoint name and suffix components.
This method is not usually called directly. Instead, the wrapping api_pattern and metadata_pattern partial methods are used.
- Parameters