Multi-level dictionaries not supported in multipart requests · Issue #3314 · encode/django-rest-framework (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
rest_framework.utils.html.is_html_input()
combined with rest_framework.utils.html.parse_html_dict()
does not detect 3+ level dictionaries, for example.
- Multipart representation of
{'a':{'b':{'c':123}}}
isQueryDict([('a.b.c',123)])
, sois_html_input()
properly detects nested dictionary. - On the second pass there is
{'b.c':123}
andis_html_input()
does not detect the nested dictionary.
My suggestion is to either instantiate or return MultiValueDict
instead of simple dict
in parse_html_dict()
(and possibly parse_html_list()
)
https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/utils/html.py