Opened 13 years ago

Closed 10 years ago

#17272 closed Bug (fixed)

Document that non-editable fields do not get validated at a model level

Reported by: Mitar Owned by: nobody
Component: Documentation Version:
Severity: Normal Keywords:
Cc: mmitar@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

From the code and behavior it seems that non-editable fields do not get validated at a model level with default validation (like null and blank check). This is a big consequence and should be documented. If you want to make all validation at a model level, according to a DRY principle, so that validation is not repeated at a form level, but then this validation is not run if you want to disable editing this fields in admin (but you want to allow editing in some your other forms where you use ModelForm). This is really strange and should be at least documented in reference for model fields, where all field options are documented, for editable, that this will disable default validation at model level.

Change History (3)

comment:1 by Luke Plant, 13 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Mitar, 13 years ago

Additionally, editable should mention that field is then hidden also from ModelForm made forms. (Together with not validated anymore at the model level.)

comment:3 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 3cd3b49eb50155ac7c29589b66498359b4934c00:

[1.6.x] Fixed #17272 -- Documented that non-editable fields are skipped during model validation.

Thanks mitar for the report.

Backport of c587bd5a94 from master

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