def test():
coords = ((1,2), (3,4), (5,6))
return response.json(coords=coords)
Returns a javascript array formatted like: [[1, 2], [3, 4], [5, 6]]
Or you can use response.json(dict(coords=coords)) to get a javascript object:
{"coords": [[1, 2], [3, 4], [5, 6]]}
Note that you also don't have to immediately return the result of response.json, you can save it and output it in the view, inside a <script> tag, for example
Hello,
Thanks for help
This communication, including any attachments, does not necessarily represent official policy of Seccuris Inc.
Please see http://www.seccuris.com/Contact-PrivacyPolicy.htm for further details about Seccuris Inc.'s Privacy Policy.
If you have received this communication in error, please notify Seccuris Inc. at in...@seccuris.com or at 1-866-644-8442.