Changes between Version 45 and Version 46 of S3/S3REST/s3_rest_controller


Ignore:
Timestamp:
10/24/10 07:45:19 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3REST/s3_rest_controller

    v45 v46  
    282282=== Pre-Process ===
    283283
     284  - ''coming soon...''
     285
     286==== Passing information between main controller & pre-processor ====
     287
     288Scope normally means that these 2 sections can only talk to each other via globals or the Request object.
     289
     290If you need to pass data between them, you can use this trick:
     291{{{
     292vars = {} # the surrounding dict
     293def prep(r, vars):
     294    vars.update(x=y) # the actual variable to pass is x
     295    return True
     296
     297response.s3.prep = lambda r, vars=vars: prep(r, vars)
     298
     299output = shn_rest_controller(module, resource)
     300
     301x = vars.get(x, None)
     302}}}
     303
     304An example usage is in {{{controllers/gis.py}}} for location()
    284305=== Post-Process ===
    285306