Django shell command to change a value in json data
- by crozzfire
I am a django newbie and i was playing around in django's manage.py shell. Here is something i am trying in the shell:
>>> data
[{'primary_program': False, 'id': 3684}, {'primary_program': True, 'id': 3685}]
>>> data[0]
{'primary_program': False, 'id': 3684}
>>> data[1]
{'primary_program': True, 'id': 3685}
>>> data[0].values()
[False, 3684]
>>> data[1].values()
[True, 3685]
>>>
How should i give a command here to update the value of primary_program in data[1] to False and keep the rest of the json the same?