Test cache for web2py load component
*e.g.*
*controllers/defaults.py*
@cache.action(time_expire = 300, cache_model = cache.ram, quick = 'SVLUP',
prefix = '%s/%s-' % (request.controller, request.function) )
def index():
return response.render(locals() )
@cache.action(time_expire = 300, cache_model = cache.ram, quick = 'SVLUP',
prefix = '%s/%s-' % (request.controller, request.function) )
def component_0():
return response.render(locals() )
"""
*Test Result = *
cache on component_0 function with ajax = True in index.html (index
function not cached), *result = not cached anything*
cache on index function with ajax = True in index.html (component function
not cached), *result = default/index-blabla*
cache on both functions with ajax = True in index.html, *result =
default/index-blabla and default/component_0-blabla*
cache on component_0 function with ajax = False in index.html (index
function not cached), *result = error TypeError: sequence item 2: expected
string, NoneType found*
cache on index function with ajax = False in index.html (component function
not cached), *result = default/index-blabla*
cache on both functions with ajax = False in index.html, *result = error
TypeError: sequence item 2: expected string, NoneType found*
*N.B*
just comment the @cache.function for test function not cached
"""
*views/index.html*
{{extend 'layout.html'}}
{{=LOAD('default', 'component_0.load', *ajax = False*, target =
'component_0') }}
*views/component_0.load*
<div>
{{=A(T('Test'), _class = "btn btn-info", _href = URL('test') ) }}
</div>
why the ajax value (True or False in load component in index.html file) can
have different result (error traceback occured)?
thanks and best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.