readthedocs.org
readthedocs.org copied to clipboard
Form: prevalidation form tuning
A few notes to come back to for tuning on this pattern:
- [ ] Turn the prevalidate form into a mixin, so that the base form can be
forms.Formorforms.ModelFormwithout struggling with any conflicts. Maybe this isn't necessary. - [ ]
is_disabledshould referenceself.errorsI think. This would populate the prevalidation errors ifform.errorswasn't called first. The use case here is when displaying the form, we might use<form {% if form.is_disabled %}inert{% endif %}>before we actually call{{ form | crispy }}. The crispy filter callsform.errorswhich populates all the validation errors. - [ ] https://github.com/readthedocs/ext-theme/issues/279 -- a few options here are
<form inert>, disabling all of the fields in the Form class, or wrapping with.ui.disabled.segmentinstead. There is no.ui.disabled.formunfortunately. - [ ] Revisit disabling forms pattern in #10656 and related PR