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 @@ -625,6 +625,17 @@ def run_validation(self, data=empty):
625
625
626
626
return value
627
627
628
+ def run_child_validation (self , data ):
629
+ """
630
+ Run validation on child serializer.
631
+ You may need to override this method to support multiple updates. For example:
632
+
633
+ self.child.instance = self.instance.get(pk=data['id'])
634
+ self.child.initial_data = data
635
+ return super().run_child_validation(data)
636
+ """
637
+ return self .child .run_validation (data )
638
+
628
639
def to_internal_value (self , data ):
629
640
"""
630
641
List of dicts of native values <- List of dicts of primitive datatypes.
@@ -663,7 +674,7 @@ def to_internal_value(self, data):
663
674
664
675
for item in data :
665
676
try :
666
- validated = self .child . run_validation (item )
677
+ validated = self .run_child_validation (item )
667
678
except ValidationError as exc :
668
679
errors .append (exc .detail )
669
680
else :
You can’t perform that action at this time.
0 commit comments