Django Rest Framework - add/remove to a list
If the collection is at another model then you must setup the serializer with the 'many' kwarg.

class CollectionContainerViewSet(viewsets.ModelViewSet):
    queryset = CollectionContainer.objects.all()
    collection_ids = serializers.PrimaryKeyRelatedField(
                      many=true,
                      queryset=Collection.objects.all()
                    )


Or maybe change the collection to accept updating many?

class CollectionViewSet(viewsets.ModelViewSet):
    queryset = Collection.objects.all()
    serializer_class = CollectionSerializer(many=True)


I guess that in most situations you don't explicitly add or remove, but you are change the collection to a known state - containing a specific set of items. If that is not the case and you really must add and remove explicitly I think it is better to have two actions, one for adding and one for removing items by id.