mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-30 18:09:59 +03:00
DictField should now correctly indicate it is not present in HTML forms
This commit is contained in:
parent
6522d4ae20
commit
99fb424586
|
@ -66,7 +66,7 @@ def parse_html_list(dictionary, prefix='', default=None):
|
|||
return [ret[item] for item in sorted(ret)] if ret else default
|
||||
|
||||
|
||||
def parse_html_dict(dictionary, prefix=''):
|
||||
def parse_html_dict(dictionary, prefix='', default=None):
|
||||
"""
|
||||
Used to support dictionary values in HTML forms.
|
||||
|
||||
|
@ -92,4 +92,4 @@ def parse_html_dict(dictionary, prefix=''):
|
|||
value = dictionary.getlist(field)
|
||||
ret.setlist(key, value)
|
||||
|
||||
return ret
|
||||
return ret if ret else default
|
||||
|
|
Loading…
Reference in New Issue
Block a user