Opened 5 years ago

Closed 22 months 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


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 Changed 5 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by mitar

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 Changed 22 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

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