python – Django serializer requiring a dict instead of a model instance

I’m trying to make a really simple serialization in a viewset in django, but my serializer, which should require the instance to be serialized, is requiring a dict. This is my custom serializer: class JSONAPIModelSerializer(serializers.ModelSerializer): def __init__(cls, *args, **kwargs): if kwargs.get(‘many’, False) is True: context = kwargs.get(‘context’, {}) context.update({‘is_many’: True}) kwargs.update({‘context’: context}) return super().__init__(cls, *args, … Read more