I'd like to create a REST API for an object which can be partially updated. On http://www.django-rest-framework.org/api-guide/serializers/#partial-updates and example is given in which partial=True is passed when instantiating the serializer:
# Update `comment` with partial data
serializer = CommentSerializer(comment, data={'content': u'foo bar'}, partial=True)
In my case, however, the model (which is called SessionType) has the following viewset:
class SessionTypeViewSet(viewsets.ModelViewSet):
queryset = SessionType.objects.all()
serializer_class = SessionTypeSerializer
where the serializer is defined as
class SessionTypeSerializer(serializers.ModelSerializer):
class Meta:
model = SessionType
fields = ('title',)
How can I adapt the serializer in this use case so that partial is always True?