File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,17 @@ def run_validation(self, data=empty):
614
614
615
615
return value
616
616
617
+ def run_child_validation (self , data ):
618
+ """
619
+ Run validation on child serializer.
620
+ You may need to override this method to support multiple updates. For example:
621
+
622
+ self.child.instance = self.instance.get(pk=data['id'])
623
+ self.child.initial_data = data
624
+ return super().run_child_validation(data)
625
+ """
626
+ return self .child .run_validation (data )
627
+
617
628
def to_internal_value (self , data ):
618
629
"""
619
630
List of dicts of native values <- List of dicts of primitive datatypes.
@@ -640,7 +651,7 @@ def to_internal_value(self, data):
640
651
641
652
for item in data :
642
653
try :
643
- validated = self .child . run_validation (item )
654
+ validated = self .run_child_validation (item )
644
655
except ValidationError as exc :
645
656
errors .append (exc .detail )
646
657
else :
You can’t perform that action at this time.
0 commit comments