mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Create lists only under certain conditions
This commit is contained in:
parent
8e332ad16f
commit
7ed8a480a3
|
@ -422,7 +422,10 @@ class Field(object):
|
||||||
if getattr(self.root, 'partial', False):
|
if getattr(self.root, 'partial', False):
|
||||||
return empty
|
return empty
|
||||||
return self.default_empty_html
|
return self.default_empty_html
|
||||||
ret = dictionary.getlist(self.field_name)
|
if len(dictionary.getlist(self.field_name)) > 1:
|
||||||
|
ret = dictionary.getlist(self.field_name)
|
||||||
|
else:
|
||||||
|
ret = dictionary.get(self.field_name)
|
||||||
if ret == '' and self.allow_null:
|
if ret == '' and self.allow_null:
|
||||||
# If the field is blank, and null is a valid value then
|
# If the field is blank, and null is a valid value then
|
||||||
# determine if we should use null instead.
|
# determine if we should use null instead.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user