Please show your exact code. The code I have shown works as expected.
Anthony
On Wednesday, January 29, 2014 1:45:03 AM UTC-5, Calvin wrote:
Yes-you are right. I had meant XML object, but the issue still persists.
Even with the XML() function wrapping the cache output, the output rendered
Thanks Anthony. It still appears to be returning the string result rather
than the HTML object - even for the first time the function is called
(uncached). I have cleared the cache (using redis cache).
On Monday, 27 January 2014 23:38:30 UTC+8, Anthony wrote:
Don't use XML() in your SMALL
On Wednesday, January 29, 2014 12:19:54 AM UTC-5, Calvin wrote:
Thanks Anthony. It still appears to be returning the string result rather
than the HTML object - even for the first time the function is called
(uncached). I have cleared the cache (using redis cache).
Not sure what you mean.
Yes-you are right. I had meant XML object, but the issue still persists.
Even with the XML() function wrapping the cache output, the output rendered
on the browser is a string with the tags printed. In this case, this always
appears while previously, it would only occur after the cache has been
Don't use XML() in your SMALL definition. Instead, create the entire HTML
helper object, call the .xml() method, store the resulting string in the
cache, and then after retrieving from cache, use XML() to display the
string in a view. For example:
myoutput = XML(cache.disk('Hello', lambda:
Thanks Leonel-I tried this without any success. It still rendering
incorrectly but this time consistently before and after caching.
On Tuesday, 21 January 2014 03:34:39 UTC+8, Leonel Câmara wrote:
You can use {{=XML(output, sanitize=False)}} to get the correct rendering
--
Resources:
-
You can use {{=XML(output, sanitize=False)}} to get the correct rendering
--
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
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
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
9 matches
Mail list logo