Changes between Version 56 and Version 57 of S3REST


Ignore:
Timestamp:
08/22/10 07:34:41 (11 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3REST

    v56 v57  
    151151There 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.
    152152
     153PostP Examples:
     154{{{
     155def user_postp(jr, output):
     156    # Replace the ID column in List views with 'Action Buttons'
     157    shn_action_buttons(jr)
     158    return output
     159response.s3.postp = user_postp
     160}}}
     161
     162{{{
     163def 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,
     167module, resource))
     168   return output
     169response.s3.postp = postp
     170}}}
    153171==== Passing information between main Controller & Prep ====
    154172Scope normally means that these 2 sections can only talk to each other via globals or the Request object.