but why since data=dict(options='{"mode" : "calbox"}') works fine ?
Il giorno martedì 29 ottobre 2013 13:49:12 UTC+1, Anthony ha scritto:
>
> Anyway, it might not be a bad idea to allow the option to use single
> quotes around an HTML attribute, though not sure of the best way to achieve
> that. Maybe use a double underscore to identify such attributes:
>
> INPUT(..., **{'__data-options': XML('{"mode":"calbox"}')})
>
> or add a "json" argument to specify attributes to be treated as JSON:
>
> INPUT(..., json={'data-options': '{"mode":"calbox"}'})
>
> In the above case, it would know to use single quotes and to wrap the
> string in XML(). Perhaps it could also be smart enough to take a dict or
> list and automatically convert to a JSON string.
>
> Anthony
>
> On Tuesday, October 29, 2013 8:36:19 AM UTC-4, Anthony wrote:
>>
>>
>> @Anthony
>>>
>>> from module import *
>>> def f():
>>> header = ...
>>> content = GRID(... ( # CALBOX used to create one of the columns
>>> footer = ....
>>> return {'page':PAGE(header, content, footer)}
>>>
>>
>> I guess it's hard to say without knowing what those other functions do,
>> but I don't think web2py is not doing the escaping (at least, if you
>> include the XML object I suggested either directly in a page or within an
>> HTML helper, the quotes do not get escaped when the view is serialized).
>>
>> Anthony
>>
>
--
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.