You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I call to_dict(flat=False) on a CombinedMultiDict, obtained from combining two MultiDicts with overlapping keys, only the values of the last MultiDict are returned.
# altered from documentation to make keys overlapping.fromwerkzeug.datastructuresimportCombinedMultiDict, MultiDictpost=MultiDict([('foo', 'bar'),('foo', 'bar2')])
get=MultiDict([('foo', 'bar3')])
combined=CombinedMultiDict([get, post])
combined.getlist('foo')
>> ['bar3', 'bar', 'bar2']
combined.to_dict(flat=False)
>> {'foo': ['bar3']}
From a class that intends to combine two MultiDicts, I expect the result from one of its methods to be a combined result.
Environment:
Python version: 3.6.8
Werkzeug version: 1.0.1
The text was updated successfully, but these errors were encountered:
GuidoTournois
changed the title
to_dict method on CombinedMultiDict doesn't give expected result.
to_dict method on CombinedMultiDict doesn't give combined result for overlapping keys
Jul 21, 2021
Hi Chima,
Thanks for your reply and thanks for picking up the issue so quickly.
Cheers,
Guido
Op zo 25 jul. 2021 om 16:07 schreef Chima Ataman ***@***.***>:
Whenever I call
to_dict(flat=False)
on aCombinedMultiDict
, obtained from combining two MultiDicts with overlapping keys, only the values of the last MultiDict are returned.From a class that intends to combine two MultiDicts, I expect the result from one of its methods to be a combined result.
Environment:
The text was updated successfully, but these errors were encountered: