maintaining order in json (python flask) -
this question has answer here:
i made sorted dictionary pass through json javascript, however, seems whenever throw json.dumps()
changes order alphabetical keys. critical keep in order or else not work. there way achieve this?
objects in json unordered collection of key:value pairs (same dictionaries in python), should use different data structure if order relevant.
a structure (in json) work:
{ "columns" : [ "id", "name", "age"], "rows" : [[ "john", "john doe", 42], [ "jane", "jane miller", 28] ] }
Comments
Post a Comment