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 a surf.resource.Resource class

note: 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

new(json_params)[source]

REST : GET /new: Form to create a new item. creates a new instance of the current Resource type

show(id)[source]

REST : GET /id: Show a specific item. show / retrieve the specified resource

update(id, json_params)[source]

REST : PUT /id: Update an existing item., update an instnaces attributes with the supplied parameters

Previous topic

The surf.resource.result_proxy Module

Next topic

The surf.serializer Module

This Page