This commit is contained in:
Guan Ke 2017-04-17 00:21:00 +00:00 committed by GitHub
commit fb1c45ed79

View File

@ -482,9 +482,9 @@ class ManyRelatedField(Field):
if self.field_name not in dictionary:
if getattr(self.root, 'partial', False):
return empty
return dictionary.getlist(self.field_name)
return dictionary.getlist(self.field_name) or empty
return dictionary.get(self.field_name, empty)
return dictionary.get(self.field_name, empty) or empty
def to_internal_value(self, data):
if isinstance(data, type('')) or not hasattr(data, '__iter__'):