mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Binding child should happen in bind no init
It should fix several issues related to child caching wrong root, the one I was dealing with was that child of a `many=True` serializer didn't have access to context.
This commit is contained in:
parent
83c535e9cc
commit
7dfc791841
|
@ -563,10 +563,10 @@ class ListSerializer(BaseSerializer):
|
|||
assert self.child is not None, '`child` is a required argument.'
|
||||
assert not inspect.isclass(self.child), '`child` has not been instantiated.'
|
||||
super(ListSerializer, self).__init__(*args, **kwargs)
|
||||
self.child.bind(field_name='', parent=self)
|
||||
|
||||
def bind(self, field_name, parent):
|
||||
super(ListSerializer, self).bind(field_name, parent)
|
||||
self.child.bind(field_name='', parent=self)
|
||||
self.partial = self.parent.partial
|
||||
|
||||
def get_initial(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user