Skip to content
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

Update models's fields' _Choices type #2476

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stianjensen
Copy link

Django 5 allows model field choices to be callables, mappings or subclasses of models.Choices. This commit introduces these options in the stubs.

Continuation of #2368, to fix a merge conflict, avoid issues with importing Tuple instead of using tuple, and avoid unnecessary formatting changes.

django-stubs/utils/choices.pyi Outdated Show resolved Hide resolved
tests/typecheck/db/models/test_fields.yml Outdated Show resolved Hide resolved
Django 5 allows model field choices to be callables, mappings or
subclasses of models.Choices. This commit introduces these options in
the stubs.

Co-Authored-By: Stian Jensen <[email protected]>
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I would like to have one more pair of eyes :)
cc @intgr @flaeppe

@sobolevn sobolevn mentioned this pull request Jan 10, 2025
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.

3 participants