[Django]-How to use PrimaryKeyRelatedField to update categories on a many-to-many relationship

6👍

For anyone else having this issue I found a solution that allows PrimaryKeyRelatedField to be read/writeable. Just add queryset

categories = serializers.PrimaryKeyRelatedField(many=True, queryset=Category.objects.all())

It will still filter on the correct relationship which is a bit confusing.

Leave a comment