mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
modify get_value method for get multi-value
Because dictionary is queryDict, If you send multiple values with the same field_name, When using the '__get__' method, only the last element is reflected. Use the 'getlist' method to return a list with multiple values
This commit is contained in:
parent
5e7497bfe0
commit
d4cc5478dd
|
@ -422,7 +422,7 @@ 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[self.field_name]
|
ret = dictionary.getlist(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