Allow default "custom_field" setting for "selection" fields #2159
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Issue type
[X] Feature request
Environment
Description
This was brought up in the NetworkToCode Slack channel, I'm simply documenting the request here for recording purposes.
Currently, if you create a
custom_field
as a typeSelection
, any text entered into theDefault
is ignored (but is correctly remembered). Granted, the comments below that input area do state "N/A for selection fields". However, while briefly looking into the Django documentation for ModelChoiceField (which I believe is what you are using), there didn't seem to be any reason why this is not a valid option.In the Slack channel, when the question was asked, the answer was "it was an issue with validation". I completely understand why you would want to validate that field, however, the same type of validation is not done for booleans either.
For example. if something besides "true" or "false" are entered as the default, such as "foobar", it is accepted but simply ignored when you try and create a new object for the model it the
custom_field
was created for.I'm hoping for the same thing for a
Selection
field. If someone wants to set a valid option as the default and it is correct, use it, if it doesn't match a defined valid option, simply ignore it.Any thoughts one way or the other?
The text was updated successfully, but these errors were encountered: