Is it possible to validate a form in a page processor?
I know you're able to override the associated form by something like:
*@processor_for('rsvp')*
*def rsvp_form(request, page): *
* form = RsvpForm() # a custom form i created to override the page's
form*
* return {"form": form}*
But how would you go about intercepting and adding custom validation to the
default page's form?
For instance, I am trying to do something like:
*@processor_for('rsvp')*
*def rsvp_form(request, page): *
* form = page.getAssociatedForm() # fabricated method to get the
Page's form instance*
* form.addError('Some Error') # add custom validation*
* return {"form": form}*
Am I going down the wrong path? Is there another way to go about this?
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.