You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.Form or forms.ModelForm without struggling with any conflicts. Maybe this isn't necessary.
is_disabled should reference self.errors I think. This would populate the prevalidation errors if form.errors wasn'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 calls form.errors which populates all the validation errors.
A few notes to come back to for tuning on this pattern:
forms.Form
orforms.ModelForm
without struggling with any conflicts. Maybe this isn't necessary.is_disabled
should referenceself.errors
I think. This would populate the prevalidation errors ifform.errors
wasn'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.errors
which populates all the validation errors.<form inert>
, disabling all of the fields in the Form class, or wrapping with.ui.disabled.segment
instead. There is no.ui.disabled.form
unfortunately.The text was updated successfully, but these errors were encountered: