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
As it is perfectly fine to have no form_valid() method - WizardView provides a done() method for the final good end - there is no way to interact with the view if one form step was invalid, and I want to change the result.
My use case: I mix the forms with some mixins that provide dynamic HTMX updates - if one field is changed, this could trigger a reload of the whole form with different params (querysets, other fields etc) by HTMX.
This must be done using POST, and therefore the form is validated, suddenly showing errors all over the place (empty fields etc).
I don't want that, so I changed the mixin class' form_invalid() method like this in my mixin:
if there was sent a special parameter with the HTMX request, the form errors are cleared. This works reasonably well.
But I can't do that when I subclass WizardView. It could be solved by adding a WizardView.invalid_form() method, which is called instead of just rendering the form manually in post(), and could be overridden then in subclasses if needed.
The text was updated successfully, but these errors were encountered:
As it is perfectly fine to have no
form_valid()
method - WizardView provides adone()
method for the final good end - there is no way to interact with the view if one form step was invalid, and I want to change the result.My use case: I mix the forms with some mixins that provide dynamic HTMX updates - if one field is changed, this could trigger a reload of the whole form with different params (querysets, other fields etc) by HTMX.
This must be done using POST, and therefore the form is validated, suddenly showing errors all over the place (empty fields etc).
I don't want that, so I changed the mixin class'
form_invalid()
method like this in my mixin:if there was sent a special parameter with the HTMX request, the form errors are cleared. This works reasonably well.
But I can't do that when I subclass
WizardView
. It could be solved by adding aWizardView.invalid_form()
method, which is called instead of just rendering the form manually inpost()
, and could be overridden then in subclasses if needed.The text was updated successfully, but these errors were encountered: