From d4cc5478ddf5b70034e2e8ec58031e58d52c4308 Mon Sep 17 00:00:00 2001 From: sol HYUN Date: Mon, 5 Dec 2016 18:51:03 +0900 Subject: [PATCH] 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 --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 13b5145ba..de279f292 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -422,7 +422,7 @@ class Field(object): if getattr(self.root, 'partial', False): return empty return self.default_empty_html - ret = dictionary[self.field_name] + ret = dictionary.getlist(self.field_name) if ret == '' and self.allow_null: # If the field is blank, and null is a valid value then # determine if we should use null instead.