Opened 6 years ago

Closed 6 years ago

#19997 closed Cleanup/optimization (fixed)

Custom EMPTY_VALUES for form fields.

Reported by: loic84 Owned by: loic84
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: 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.

Attachments (1)

formfields_empty_values.diff (13.6 KB) - added by loic84 6 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 6 years ago by Claude Paroz

Triage Stage: UnreviewedAccepted

Changed 6 years ago by loic84

comment:3 Changed 6 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 4cccb85e292fea01b3459cd97d751ed35179a7b7:

Fixed #19997 -- Added custom EMPTY_VALUES to form fields

Thanks Loic Bistuer for the report and the patch.

Note: See TracTickets for help on using tickets.
Back to Top