Yes, though by default the text will be escaped, so to avoid that, use XML()
.
{{=XML(json.dumps(testdictionary))}}
Actually, might be cleaner to call json.dumps
in the controller.
Pregunta
Can we directly print dictionary using json.dumps (testdictionary) in view of web2py. Returning test dictionary from the controller
Solución
Yes, though by default the text will be escaped, so to avoid that, use XML()
.
{{=XML(json.dumps(testdictionary))}}
Actually, might be cleaner to call json.dumps
in the controller.