I have a Postgres db where OrderedDict
has been saved as a string. I need to convert this string into json/dict so that it can be saved in a JSONField. How can I convert this string into dict?
String example -
OrderedDict([('order_id', 'xxxxxx'), ('tracking_id', 'xxxxxx'), ('bank_ref_no', 'xxxxx'), ('order_status', 'Success')])
I tried json.loads(string)
but it gives a decoding error. Any solution apart from manually parsing the string?