Changes between Version 5 and Version 6 of S3/S3Method


Ignore:
Timestamp:
01/28/11 01:25:33 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Method

    v5 v6  
    44'''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.
    55
    6 == Implementing Method Handlers ==
     6== Implementing Methods ==
    77
    8 Method handlers must be callable objects, i.e. they can be instances of classes which implement the {{{__call__}}} method, lambdas or normal functions.
     8In general, method handlers must be callable objects, i.e. they can be instances of classes which implement the {{{__call__}}} method, lambdas or normal functions.
    99
    1010In any case, they must take the {{{S3Request}}} instance (representing the HTTP request) and a variable list of named arguments as parameters:
     
    3131
    3232The returned {{{dict}}} will be passed to the view, so it would usually contain the output data.
     33
     34== Configuring Methods ==
     35
     36Methods 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
     41where a) overrides b).
    3342
    3443== S3Method Interface ==