Changes between Version 5 and Version 6 of S3/S3Method
- Timestamp:
- 01/28/11 01:25:33 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3Method
v5 v6 4 4 '''S3Method''' is an interface to implement method handlers for the [wiki:S3XRC/RESTfulAPI RESTful API]. Method handlers are used to perform requested actions on S3Resources, and produce the output for the view. 5 5 6 == Implementing Method Handlers ==6 == Implementing Methods == 7 7 8 Method handlers must be callable objects, i.e. they can be instances of classes which implement the {{{__call__}}} method, lambdas or normal functions.8 In general, method handlers must be callable objects, i.e. they can be instances of classes which implement the {{{__call__}}} method, lambdas or normal functions. 9 9 10 10 In any case, they must take the {{{S3Request}}} instance (representing the HTTP request) and a variable list of named arguments as parameters: … … 31 31 32 32 The returned {{{dict}}} will be passed to the view, so it would usually contain the output data. 33 34 == Configuring Methods == 35 36 Methods of the RESTful API can be configured: 37 38 a) using {{{s3xrc.model.set_method}}} for explicit URL methods 39 b) using {{{S3Resource.set_handler}}} for a particular S3Resource instance 40 41 where a) overrides b). 33 42 34 43 == S3Method Interface ==