Hey Danny,

Check out the example at
https://mezzanine.jupo.org/docs/content-architecture.html#page-processors,
I think it will get you started down the right path and shows how to handle
validation in a processor.


On Tue, Mar 4, 2014 at 9:37 AM, Danny flack <flackatt...@gmail.com> wrote:

> 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 mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to