1👍
✅
You might try to subclass ModelSerializer
instead of HyperlinkedModelSerializer
and then supply the queryset argument for the PrimaryKeyRelatedField
:
categories = serializers.PrimaryKeyRelatedField(many=True,
queryset=Categories.objects.all())
Source:stackexchange.com