-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comments
This was referenced Dec 13, 2024
swrichards
added a commit
that referenced
this issue
Dec 17, 2024
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
swrichards
added a commit
that referenced
this issue
Dec 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.The text was updated successfully, but these errors were encountered: