djangorestframework-types
djangorestframework-types copied to clipboard
serializer.instance is of type Any
The type of serializer.instance and the return type of serializer.save() are Any. I saw in djangorestframework-stubs that I had to create the class like this:
class MyModelSerializer(serializers.ModelSerializer[MyModel]):
class Meta:
model = MyModel
fields = ("id", "example")
but it doesn't work either.
related: https://github.com/typeddjango/djangorestframework-stubs/issues/71
I think this is covered under #46, but I agree this would be very helpful to have