We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have two models with matching managers and querysets, and sometimes use them as a union.
model: type[Foo] | type[Bar] result = model.objects.shared_method()
Unable to resolve return type of queryset/manager method "shared_method"
result is inferred as the union of return types of Foo.objects.shared_method() and Bar.objects.shared_method().
result
Foo.objects.shared_method()
Bar.objects.shared_method()
Linux b5ca85c5b236 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux
python
django
mypy
django-stubs
django-stubs-ext
The text was updated successfully, but these errors were encountered:
PR to the plugin code is welcome!
Sorry, something went wrong.
@sobolevn good suggestion, #2027 :)
Successfully merging a pull request may close this issue.
Bug report
What's wrong
I have two models with matching managers and querysets, and sometimes use them as a union.
How is that should be
result
is inferred as the union of return types ofFoo.objects.shared_method()
andBar.objects.shared_method()
.System information
Linux b5ca85c5b236 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux
python
version: 3.11django
version: 4.2mypy
version: 1.3django-stubs
version: 4.2.1django-stubs-ext
version: 4.2.1The text was updated successfully, but these errors were encountered: