updating QueryDict in another dict gives unexpected results.
|Reported by:||Harro||Owned by:||Tomek Paczkowski|
|Cc:||hvdklauw@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I noticed a small "bug" in the QueryDict.
When I have an existing dict and want to add the get or postdata to it using my_dict.update(request.POST).
This results in a dict with all the values as lists. I can understand why the QueryDict might work that way, the same key could have multiple values. Except that the QueryDict
does some magic that when you iterate over it it returns the first item in the list.
This limitation should be documented, and maybe a function should be added to the QueryDict to turn it into a normal dict.
Change History (11)
comment:3 Changed 5 years ago by
|Owner:||changed from nobody to Tomek Paczkowski|
|Status:||new → assigned|
comment:8 Changed 5 years ago by
|Triage Stage:||Accepted → Ready for checkin|