typeddjango / django-stubs

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

Do many related manager creation during semantic analysis #2231

Closed flaeppe closed 3 weeks ago

flaeppe commented 3 weeks ago

When finding a ManyToManyField we can directly create 2 ManyRelatedManagers, one for each side of the relation. This makes the model declaring the ManyToManyField be the one who contributes the ManyRelatedManagers.

Trying to place some related code closer to each other. This time we move some code out of the type checking phase to semantic analysis.

Refs: