Changes between Version 84 and Version 85 of S3/S3REST/s3_rest_controller


Ignore:
Timestamp:
06/05/13 19:28:53 (8 years ago)
Author:
hardik juneja
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3REST/s3_rest_controller

    v84 v85  
    500500}}}
    501501
    502 This example would switch to my_list_controller instead of shn_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.
     502This 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.
    503503
    504504While 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).
     
    520520response.s3.prep = lambda r, vars=vars: prep(r, vars)
    521521
    522 output = shn_rest_controller(module, resource)
     522output = s3_rest_controller(module, resource)
    523523
    524524x = vars.get(x, None)
     
    600600    s3db.set_method(module, resource, method="report", action=warehouse_report)
    601601
    602     return shn_rest_controller(module, resource, ...)
     602    return s3_rest_controller(module, resource, ...)
    603603
    604604def warehouse_report(r, **attr):