Description
Bug report
Hi, I'm not sure if this is a genuine bug or if I am just doing something wrong.
I recently used django-polymorphic to add a new feature in my project and mypy is now breaking. I have plenty of errors:
error: Could not resolve manager type for "<MyModel>.objects"
and
error: Couldn't resolve related manager for relation '<related_name>'
After checking the django polymorphic docs: https://django-polymorphic.readthedocs.io/en/stable/managers.html#manager-inheritance I can see that the manager is inherited. Could that be the source of mypy's troubles here? I feel it could be, but I'd be happy to get opinions.
Is that a known issue with django-polymorphic that I simply am not aware of? If so, is there a (concise) way around it? If not, I'll probably fallback to the "multiple FK in a model" approach to keep mypy running...
Happy to hear if I'm missing something obvious!
Thanks in advance! :)
System information
- OS: macOS Monterey 12.6
python
version: 3.10.6django
version: 4.1mypy
version: 0.971django-stubs
version: 1.12.0django-stubs-ext
version: 0.5.0