Let's say that we have this dict:
{
"app_url": "",
"models": [
{
"perms": {
"add": true,
"change": true,
"delete": true
},
"add_url": "/admin/cms/news/add/",
"admin_url": "/admin/cms/news/",
"name1": ""
}
],
"has_module_perms": true,
"name2": "u\u0027CMS\u0027"
}
How to set a new value for the key add_url if the requirement is to only provide the key and the value?
So i don't want to do something like data["models"]["add_url"] = value but instead i'd like to pass only "add_url" and the new value to a function.
In my case every key in the dict is a unique str so that it can't happen that a key appears more then once.