-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Description
To allow type checking efforts to properly type the methods of ModelSerializer
it needs to be made generic with regards to the model it serializes. Since django-rest-framework has chosen to not own any annotations themselves the only way to achieve that will be to implement __class_getitem__
. Stub implementors can then make the class generic and calling ModelSerializer[Author]
will not yield subscriptability errors at runtime.
Note that this is the unfortunate direction Django has chosen as well.
This is the relevant issue in djangorestframework-stubs for reference.
kalekseev, sobolevn and michael-k
Metadata
Metadata
Assignees
Labels
No labels