12
if request.method == 'POST':
updated_request = request.POST.copy()
updated_request.update({'credit_type': [credit_type]})
0
You can try to unpack the request.POST
dictionary and add your own key-value pairs. This way you keep the original dictionary intact.
new_dict = {**request.POST, 'custom_key': custom_val}
- [Django]-Displaying pyqtgraph and pyqt widgets on web
- [Django]-Django Queryset Count
- [Django]-Django occasionally throwing a NoReverseMatch
- [Django]-Missing header files while installing packages using pip
- [Django]-Adding days to a date via the ORM
Source:stackexchange.com