The surf.rest
Module¶
-
class
surf.rest.
Rest
(resources_namespace, concept_class)[source]¶ Bases:
object
The
Rest
class handles the generation of REST like methods to perform CRUD operations on asurf.resource.Resource
classnote: The REST api exposed is designed in accordance with the REST controller used in pylons applications, it adheres to the REST specification and offers extra features
the resource is the
surf.resource.Resource
class for which the REST interface is exposed, the resources_namespace represents the URI that instances will be using as subjects-
create
(json_params)[source]¶ REST : POST /: Create a new item, creates a new instance of the current Resource type
-
delete
(id)[source]¶ REST : DELETE /id: Delete an existing item. removes the denoted instance from the underlying store
-
edit
(id, json_params)[source]¶ REST : GET /id;edit: updates an instances attributes with the supplied parameters
-
index
(offset=None, limit=None)[source]¶ REST : GET /: All items in the collection, returns all instances for the current Resource
-