方法class FirstModelSerializer(serializers.ModelSerializer): secondModel = SerializerMethodField() class Meta: model = FirstModel fields = '__all__' def g...
解决方法partial设置为True(默认是False)ser = BookModelSerializer(instance=obj,data=new_request_data,partial=True) if ser.is_valid(): obj = ser.save()参考https://www.lmlphp.com/user/16758/article/item/582792/