class ChildSerializer(ModelSerializer):

    def to_internal_value(self, data):
        if data.get('id'):
            return get_object_or_404(Child.objects.all(), pk=data.get('id'))
return super(ChildSerializer, self).to_internal_value(data)
DRF: Simple foreign key assignment with nested serializers?