Thanks Leonel! That works.
I ended up doing it as follows:
SMALL = lambda x, **kwargs: XML(TAG.small(x, **kwargs).xml())
cache.disk('Hello', lambda: CAT(P('Hello'), SMALL('World')), time_expire=100
)
However, with such an approach, the retrieved cache value is a string
rather than an XML object which means that I get the following output
Hello
<small>World</small>
as the rendered output rather than
Hello
World
Any further thoughts?
On Wednesday, 15 January 2014 23:43:56 UTC+8, Leonel Câmara wrote:
>
> Just save the generated xml instead
>
>
> cache.disk('Hello', lambda: CAT(P('Hello'), SMALL('World')).xml(),time_expire
> =100)
>
--
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/groups/opt_out.