Skip to content

Conversation

@yhoiseth
Copy link
Contributor

@yhoiseth
Copy link
Contributor Author

yhoiseth commented Jan 26, 2020

Troubleshooting notes

  • All jobs pass except Typecheck Django 2.2 test suite with python 3.7

Reproduce locally

Done. (Everything below UNUSED IGNORES is present on master, as well.)

Try to fix

Union[Type[Any], Type[Model]] doesn't work, either… Weird, considering that Type[Any] works.

Two models are failing: SiteManager and Food. They both have attributes/methods that aren't present on Model. Considering that they are both models, I think it makes sense that the type hint Type[Model] is more correct than Type[Any]. But the test doesn't agree.

It's unclear to me why it works with 3.0 but not with 2.2.

Appending # type: ignore to the failing test lines works, but not sure whether that's a good idea. Also unsure what the repo situation with django-sources/ is.

Next steps

I don't have any more ideas for how to proceed.

@sobolevn sobolevn requested a review from mkurnikov February 9, 2020 15:03
@mkurnikov
Copy link
Member

I think it requires plugin support, otherwise, it will create a bunch of false-positives everywhere.

@intgr intgr added the stale Pull requests that have been out of date or unmergeable for a long time. label Jan 10, 2023
kalekseev pushed a commit to kalekseev/django-stubs that referenced this pull request Jun 19, 2025
…o#305)

`**extra` ends up in `request.META` which can contain things like `CSRF_COOKIE_USED = True`, so use `object` type to allow anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Pull requests that have been out of date or unmergeable for a long time.

Development

Successfully merging this pull request may close these issues.

Too broad return value for apps.get_model()

4 participants