I would like to utilize the built-in Page content model "Form" and be able 
to intercept posted form data via a Page Processor to perform custom 
validation on it.

I know you can return a dictionary with extra response content, but I'm at 
a loss at how to force an "invalid" form submission.

In the example below, there is a Page slug with "rsvp" and it has a Form 
content model with a bunch of fields.

I'd like to do something like this which would be able to invalidate the 
form and prevent it from submitting successfully.

@processor_for('rsvp')         
def rsvp_form(request, page):  
    if not request.POST.get('something'):
        return {'errors': 'tons of them'}
    return {}

Is that something that's possible?

-- 
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.

Reply via email to