I'm building a Flask app with a Treant.js tree. In this example the tree diagram takes data like so
lana =
{
text: {name: "lana"},
image: "static/images/lana.png",
parent: malory
}
That works fine. I now need to recreate that from a Python object
Right now I have
d = {}
d["parent"] = "malory"
d["text"] = { 'name': "lana" }
d['image'] = 'static/images/stripe.png'
print json.dumps(d)
>>> {"text": {"name": "lana"}, "image": "static/images/stripe.png", "parent": "malory"}
Also, when I log it to the console in the browser I get the same result.
Which does not work. All of the keys have quotes around which seems to cause the issue. How do I remove the quotes around the keys.