Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I not able to update test__user_id key in dictionary?

Tags:

python

I am updating dictionary which containing data like,

dict_temp = {'description': 'hello', 'id': 683,  'status': u'pending', 'test__user_id': 430}

I have tried to update using dict_temp['test__user_id'] = 520 but not able to get updating dictionary.

I have search online for solution but not able to find any.

Hope if anyone have solution or suggestion for my issue.

Issue

As in above screenshot I can update values of description but not able to update value of test__user_id.

like image 691
Moon Avatar asked Nov 25 '25 13:11

Moon


1 Answers

I have tried same above code in console of python and able to update test__user_id value successfully.

>>> dict_temp = {'description': 'hello', 'id': 683,  'status': u'pending', 'test
__user_id': 430}
>>> dict_temp['test__user_id'] = 520
>>> dict_temp
{'description': 'hello', 'id': 683, 'status': 'pending', 'test__user_id': 520}

Please share full trace-back if you still getting error.

like image 80
Deep Avatar answered Nov 27 '25 02:11

Deep



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!