django-stubs
django-stubs copied to clipboard
Too broad return value for apps.get_model()
When writing data migrations, you use apps.get_model()
instead of the usual model imports.
However, PyCharm doesn't understand that the returned values are models:
The problem is that get_model
is set to return Type[Any]
. I'll create a pull request to show what I mean.
Thanks for the bug report and a quick fix!
No worries! Thanks for your work on django-stubs—I find that it's making Django programming a lot easier and safer 😀
@sobolevn Can you please add the help wanted
label to this issue?
Sure! Thanks a lot for the report.
@sobolevn @RJPercival any chance to get this closed in the near future ?
What about this: https://github.com/typeddjango/django-stubs/pull/1318
I think this fixes it for everyone.