I am developing a user interface with Django. I have performed some operations in the views.py. and i have retrieved values which looks like this.
results = [{'start_time': '23:51:58', 'id_start_time': datetime.time(23, 51, 58)}, {'start_time': '23:59:04', 'id_start_time': datetime.time(23, 59, 4)}]
i am trying to save this into a json object, to be transferred back to the HTML page, where i have JQuery syntax to perform operations on these values, but for some reason its not working.
The syntax i used is,
import json
json_var = json.dumps(results)
i have also used syntax of,
variable_result = simplejson.dumps(results)
But both of them does not seem to work or i may not have understood the logic of how it works. If the syntax is correct, can u please tell me how to view those stored objects. If the syntax is not correct, can someone please tell me how it should work with a perfect code.