Changes between Version 26 and Version 27 of S3REST
- Timestamp:
- 05/14/10 06:59:09 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3REST
v26 v27 14 14 s3rest is an instance of the RESTController class, implemented in modules/s3rest.py. 15 15 16 Instead of the web2py ''request'' object, s3rest uses the '' XRequest'' class (described below) to represent the current REST request. Other than web2py/request, the XRequest of the current call is not a global object, but gets passed as argument when calling REST method handlers.16 Instead of the web2py ''request'' object, s3rest uses the ''S3Request'' class (described below) to represent the current REST request. Other than web2py/request, the XRequest of the current call is not a global object, but gets passed as argument when calling REST method handlers. 17 17 18 18 === REST Methods === … … 40 40 === CRUD Method Handlers === 41 41 42 The default method handlers for each of CRUD+S are implemented in models/01_ RESTlike_controller.py:42 The default method handlers for each of CRUD+S are implemented in models/01_crud.py: 43 43 44 44 - shn_read(jr, **attr) … … 52 52 - import_json(jr, **attr) 53 53 54 where ''jr'' is the current '' XRequest'', and ''**attr'' contains all further arguments passed to the REST controller.54 where ''jr'' is the current ''S3Request'', and ''**attr'' contains all further arguments passed to the REST controller. 55 55 56 56 You can override these defaults at any time by … … 76 76 - '''action''' is the method handler function/lambda 77 77 78 The ''action'' method has to take the same arguments as the default handlers: ''jr'' ( XRequest) and ''**attr''.79 == XRequest ==78 The ''action'' method has to take the same arguments as the default handlers: ''jr'' (S3Request) and ''**attr''. 79 == S3Request == 80 80 81 Important: XRequest instances are generated per request and must not be stored or referenced by static or global objects to avoid memory leaks!82 === Attributes of the XRequest ===81 Important: S3Request instances are generated per request and must not be stored or referenced by static or global objects to avoid memory leaks! 82 === Attributes of the S3Request === 83 83 84 The following attributes are set during initialisation of an XRequest object, no further call is required.84 The following attributes are set during initialisation of an S3Request object, no further call is required. 85 85 86 86 ==== Controller Attributes ==== … … 133 133 - methods: '''set_attr()''' and '''get_attr()''' 134 134 135 === Methods of the XRequest ===135 === Methods of the S3Request === 136 136 137 137 '''here(representation=None)'''