Changes between Version 84 and Version 85 of S3/S3REST/s3_rest_controller
- Timestamp:
- 06/05/13 19:28:53 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3REST/s3_rest_controller
v84 v85 500 500 }}} 501 501 502 This example would switch to my_list_controller instead of s hn_list in case there is a ?mylist= in the URL. In all other cases, the default handlers are executed as usual, you still have a RESTful API for your resources.502 This example would switch to my_list_controller instead of s3_list in case there is a ?mylist= in the URL. In all other cases, the default handlers are executed as usual, you still have a RESTful API for your resources. 503 503 504 504 While you can define prep's and postp's as local functions (as in the example above) or even lambdas, it is also very well possible to create more generic, reusable prep and postp functions (e.g. to implement different method handler configurations, or to catch certain situations to bypass the CRUD, or to manipulate the output dict in a certain way). … … 520 520 response.s3.prep = lambda r, vars=vars: prep(r, vars) 521 521 522 output = s hn_rest_controller(module, resource)522 output = s3_rest_controller(module, resource) 523 523 524 524 x = vars.get(x, None) … … 600 600 s3db.set_method(module, resource, method="report", action=warehouse_report) 601 601 602 return s hn_rest_controller(module, resource, ...)602 return s3_rest_controller(module, resource, ...) 603 603 604 604 def warehouse_report(r, **attr):