typeddjango / django-stubs

PEP-484 stubs for Django
MIT License
1.52k stars 425 forks source link

Make `ReverseManyToOneDescriptor` generic over a model #2227

Closed flaeppe closed 3 weeks ago

flaeppe commented 3 weeks ago

This allows us to remove some plugin code, as we now can fall back to the default related manager on the descriptor instead of having to implement the fallback behaviour manually.

Related issues

Refs: https://github.com/typeddjango/django-stubs/pull/2214#discussion_r1632216834

flaeppe commented 3 weeks ago

Good point, we should patch ReverseManyToOneDescriptor with __class_getitem__