On Thursday, July 28, 2011 5:39:32 PM UTC-4, Tushar Chandra wrote:
>
> Hi,
> In the db, i have html code stored in a field. If i want to display it
> in the views, i have to write : response.write(variable,escape=False)
> Is it possible to use it in this manner by setting a default somewhere
> : {{=variable}}
>
You can do
{{=XML(variable)}}
If you want to allow only particular "safe" HTML tags/attributes and escape
the rest, you can do:
{{=XML(variable, sanitize=True)}}
See http://web2py.com/book/default/chapter/05#XML for more details.
Anthony