@cache(request.env.path_info, time_expire=5, cache_model=cache.ram)
To cache some db queries, however, when I go to deploy this on Google
App Engine, I receive a "PicklingError: Can't pickle <type
'function'>: attribute lookup __builtin__.function failed" You can see
the traceback here:
https://gist.github.com/1384892
I have a feeling the error has to do with caching a for loop in a
view. You can see the view here:
You can also see the "thank_yous" function here:
I think the solution lies with creating the view within the function
using return response.render() as described in the web2py book here:
http://www.web2py.com/book/default/chapter/04?search=cache+view
but I'm at a loss for how to do this. Does anyone have any clear
examples for using response.render and an html template.
Thanks!
select
are complex, un-pickleable objects; they cannot be stored in a session and cannot be cached in any other way than the one explained here.". I have never tried it on GAE
I posted an account of enabling caching with web2py on GAE in a blog
post here:
http://opensourcebroadcasting.blogspot.com/2011/11/web2py-caching-and-google-app-engine.html
All the best, JT