Changes between Version 56 and Version 57 of S3REST
- Timestamp:
- 08/22/10 07:34:41 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3REST
v56 v57 151 151 There is also a '''post-processing hook''' (response.s3.postp) that allows you to execute something directly after the REST request has been executed, but before the shn_rest_controller returns. The post-hook function will be called with the current S3RESTRequest and the output dict of its execution as arguments. 152 152 153 PostP Examples: 154 {{{ 155 def user_postp(jr, output): 156 # Replace the ID column in List views with 'Action Buttons' 157 shn_action_buttons(jr) 158 return output 159 response.s3.postp = user_postp 160 }}} 161 162 {{{ 163 def postp(r, output): 164 # Redirect to read/edit view after create rather than to list view 165 if r.representation == "html" and r.method == "create": 166 r.next = r.other(method="", record_id=s3xrc.get_session(session, 167 module, resource)) 168 return output 169 response.s3.postp = postp 170 }}} 153 171 ==== Passing information between main Controller & Prep ==== 154 172 Scope normally means that these 2 sections can only talk to each other via globals or the Request object.