Custom EMPTY_VALUES for form fields.
|Reported by:||loic84||Owned by:||loic84|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Form fields should be able to decide for themselves what value they consider empty rather than through the catch-all validators.EMPTY_VALUES.
An example of this would be a JSONField that considers an empty dict a valid non-empty value.
Model validation had the same issue, and it became problematic when the BinaryField was introduced, this has been addressed in #19989. Form fields would benefit from the same fix.
Change History (4)
comment:1 Changed 3 years ago by claudep
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted