Skip to content

Add info about custom base models #181

New issue

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

Conversation

mkurnikov
Copy link
Member

@mkurnikov mkurnikov commented Sep 23, 2019

Fixes #68

@mkurnikov mkurnikov force-pushed the add-custom-base-model-to-readme branch from 1939640 to c456680 Compare September 23, 2019 23:17
@mkurnikov mkurnikov requested a review from sobolevn September 23, 2019 23:18
@pirate
Copy link
Contributor

pirate commented Sep 23, 2019

I have some concerns with this solution, see #68 (comment)

@mkurnikov mkurnikov closed this Sep 24, 2019
voidus pushed a commit to voidus/django-stubs that referenced this pull request Apr 23, 2024
The way CPython works at runtime is to give a higher priority to the metaclass descriptors than the ones in the class itself.

Pyright 1.1.324 adjusted that but made our `.objects` typing break when using our own custom managers.

Nowadays we can use `Self` for that, which not only is more elegant but also solves this issue in a way that both mypy and pyright can resolve correctly.

Related issues:
- microsoft/pyright#5792
- microsoft/pyright#5686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Requiring field annotations even though type can be inferred from field type
2 participants