Hi all,

I can't seem to get *allow_null*` to work (or I am misunderstanding how it 
works):

# serializers.py
class ParentSerializer(serializers.HyperlinkedModelSerializer):

   children = serializers.PrimaryKeyRelatedField(many=True, queryset=Child.
objects.all(), required=False, allow_null=True)
   ...

// ajax.js

data = {name: "children", value: ""};

$.ajax({
  url: ajaxUrl,
  method: 'PATCH',
  data: data,
  traditional: true,
})


This gives me:
children: ["Incorrect type. Expected pk value, received str."]

Appreciate help in pointing out what I did wrongly!





-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to