Opened 12 years ago

Closed 12 years ago

#19997 closed Cleanup/optimization (fixed)

Custom EMPTY_VALUES for form fields.

Reported by: loic84 Owned by: loic84
Component: Forms Version: dev
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

Description

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 12 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedAccepted

by loic84, 12 years ago

comment:3 by Claude Paroz <claude@…>, 12 years ago

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