def _deserialize(self, value, attr, data):
if not is_collection(value):
value = [value]
result = []
errors = {}
for idx, each in enumerate(value):
try:
result.append(self.container.deserialize(each))
except ValidationError as e:
if e.data is not None:
result.append(e.data)
errors.update({idx: e.messages})
if errors:
raise ValidationError(errors, data=result)
return result
评论列表
文章目录