Django: Ticket #17272: Document that non-editable fields do not get validated at a model levelhttps://code.djangoproject.com/ticket/17272
<p>
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.
</p>
en-usDjangohttps://www.djangoproject.com/s/img/site/hdr_logo.gifhttps://code.djangoproject.com/ticket/17272
Trac 1.0.2lukeplantMon, 21 Nov 2011 18:08:00 GMTstage changed; needs_better_patch, needs_docs, needs_tests sethttps://code.djangoproject.com/ticket/17272#comment:1
https://code.djangoproject.com/ticket/17272#comment:1
<ul>
<li><strong>needs_better_patch</strong>
unset
</li>
<li><strong>needs_docs</strong>
unset
</li>
<li><strong>needs_tests</strong>
unset
</li>
<li><strong>stage</strong>
changed from <em>Unreviewed</em> to <em>Accepted</em>
</li>
</ul>
TicketmitarTue, 22 Nov 2011 07:56:13 GMThttps://code.djangoproject.com/ticket/17272#comment:2
https://code.djangoproject.com/ticket/17272#comment:2
<p>
Additionally, <em>editable</em> should mention that field is then hidden also from ModelForm made forms. (Together with not validated anymore at the model level.)
</p>
TicketTim Graham <timograham@…>Tue, 19 Aug 2014 11:19:13 GMTstatus changed; resolution sethttps://code.djangoproject.com/ticket/17272#comment:3
https://code.djangoproject.com/ticket/17272#comment:3
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
In <a class="changeset" href="https://code.djangoproject.com/changeset/3cd3b49eb50155ac7c29589b66498359b4934c00" title="[1.6.x] Fixed #17272 -- Documented that non-editable fields are ...">3cd3b49eb50155ac7c29589b66498359b4934c00</a>:
</p>
<div class="message"><p>
[1.6.x] Fixed <a class="closed ticket" href="https://code.djangoproject.com/ticket/17272" title="Bug: Document that non-editable fields do not get validated at a model level (closed: fixed)">#17272</a> -- Documented that non-editable fields are skipped during model validation.<br />
</p>
<p>
Thanks mitar for the report.<br />
</p>
<p>
Backport of c587bd5a94 from master<br />
</p>
</div>
Ticket