I have a dict that I want to convert in JSON using simplejson.
How can I ensure that all the keys of my dict are lowercase ?
{
"DISTANCE": 17.059918745802999,
"name": "Foo Bar",
"Restaurant": {
"name": "Foo Bar",
"full_address": {
"country": "France",
"street": "Foo Bar",
"zip_code": "68190",
"city": "UNGERSHEIM"
},
"phone": "+33.389624300",
"longitude": "7.3064454",
"latitude": "47.8769091",
"id": "538"
},
"price": "",
"composition": "",
"profils": {},
"type_menu": "",
"ID": ""
},
EDIT: Thanks all to had a look at my question, I am sorry I didn't explain in detailed why I wanted this. It was to patch the JSONEmitter
of django-piston
.
django-piston
and to be sure that the models fields are rewrite with the cls_method of the handler, I need to put them uppercase. When I convert the dictionnary in JSON I need to make sure that the key are all lowercase. – Alenaalene