문제

Can we directly print dictionary using json.dumps (testdictionary) in view of web2py. Returning test dictionary from the controller

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top