typeddjango / djangorestframework-stubs

PEP-484 stubs for django-rest-framework
MIT License
453 stars 120 forks source link

TypeError: 'type' object is not subscriptable #258

Open christianbundy opened 2 years ago

christianbundy commented 2 years ago

Bug report

What's wrong

class Foo(serializers.PrimaryKeyRelatedField[FooModel]): ...
    serializers.PrimaryKeyRelatedField[FooModel]
TypeError: 'type' object is not subscriptable

How is that should be

Success: no issues found in 1 source file

System information

Also, it isn't asked for by the template, but:

christianbundy commented 2 years ago

I've seen some open issues about similar problems, but:

I think this is an unexpected defect, but please let me know if I've just misunderstood the other issues.

monosans commented 2 years ago

Hope this helps https://github.com/typeddjango/djangorestframework-stubs/issues/255#issuecomment-1320496964