mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Merge bbea7c42bc
into fd72a814f8
This commit is contained in:
commit
fb1c45ed79
|
@ -482,9 +482,9 @@ class ManyRelatedField(Field):
|
||||||
if self.field_name not in dictionary:
|
if self.field_name not in dictionary:
|
||||||
if getattr(self.root, 'partial', False):
|
if getattr(self.root, 'partial', False):
|
||||||
return empty
|
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):
|
def to_internal_value(self, data):
|
||||||
if isinstance(data, type('')) or not hasattr(data, '__iter__'):
|
if isinstance(data, type('')) or not hasattr(data, '__iter__'):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user