mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 08:59:54 +03:00
change to get attributes from child_instance instead of general get_attribute
This commit is contained in:
parent
ec1b14174f
commit
ac49733aff
|
@ -526,7 +526,7 @@ class ManyRelatedField(Field):
|
|||
if hasattr(instance, 'pk') and instance.pk is None:
|
||||
return []
|
||||
|
||||
relationship = get_attribute(instance, self.source_attrs)
|
||||
relationship = self.child_relation.get_attribute(instance)
|
||||
return relationship.all() if hasattr(relationship, 'all') else relationship
|
||||
|
||||
def to_representation(self, iterable):
|
||||
|
|
Loading…
Reference in New Issue
Block a user