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

Default values for choices should be converted to literals #31

Closed
swrichards opened this issue Dec 13, 2024 · 0 comments · Fixed by #36
Closed

Default values for choices should be converted to literals #31

swrichards opened this issue Dec 13, 2024 · 0 comments · Fixed by #36

Comments

@swrichards
Copy link
Contributor

See #27 (comment) -- although we now convert choices to literal types, the default value is still a Choices object (or similar), which does not validate as a literal value.

swrichards added a commit that referenced this issue Dec 17, 2024
The reason here is that the source of our config values cannot
express complex types such as enum members, and that defaults
for Django fields with choices frequently include such types
(or callables returning such types). We are mainly about the
types of the values provided from outside, not of Django field
defaults (beyond null and blank), so we can leave the validation
of the default to Django.
swrichards added a commit that referenced this issue Dec 17, 2024
The reason here is that the source of our config values cannot
express complex types such as enum members, and that defaults
for Django fields with choices frequently include such types
(or callables returning such types). We are mainly about the
types of the values provided from outside, not of Django field
defaults (beyond null and blank), so we can leave the validation
of the default to Django.
swrichards added a commit that referenced this issue Dec 17, 2024
The reason here is that the source of our config values cannot
express complex types such as enum members, and that defaults
for Django fields with choices frequently include such types
(or callables returning such types). We are mainly about the
types of the values provided from outside, not of Django field
defaults (beyond null and blank), so we can leave the validation
of the default to Django.
swrichards added a commit that referenced this issue Dec 17, 2024
The reason here is that the source of our config values cannot
express complex types such as enum members, and that defaults
for Django fields with choices frequently include such types
(or callables returning such types). We are mainly about the
types of the values provided from outside, not of Django field
defaults (beyond null and blank), so we can leave the validation
of the default to Django.
swrichards added a commit that referenced this issue Dec 17, 2024
[#31] Bypass validation of defaults for Django fields containing choices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant