I'm 100% sure that this answers your question, but (following my
outline above)
   self._render_invalid(e, form='_checkout_shipping__print')
will call the _checkout_shipping__print action and apply the errors to
it, just as @validate would.  In the example, the errors are obtained
from the Invalid exception e, but they can be supplied explicitly and
they will default to self.form_errors if neither input is truthy.  If
the required format is JSON, errors are rendered directly, i.e.
without reference to the form argument.

While we're here, I should mention that I noticed this week that some
legacy cruft has been removed from @validate in the 1.0b version (work
done by Philip Jenvey I think).  I have backported the changes
(deletions mostly) to my app but I haven't got round to posting a new
gist yet.  If anyone is using the old one, please shout.

Regards,
Mike
[email protected]
http://positiveincline.com
http://twitter.com/asplake


On Feb 24, 5:25 am, Jonathan Vanasco <[email protected]> wrote:
> does this new approach allow for form errors to be re-triggered in the
> controller like my stab 
> (http://groups.google.com/group/pylons-discuss/browse_thread/thread/42...
> ) ?
>
> because that's the only thing i care about.
>
> example:
>
> from OpenSocialNetwork.lib.decorators import osn_validate ,
> osn_form_error
> from OpenSocialNetwork.lib.errors import SubmissionError
>
> @osn_validate( schema=Forms_Checkout.Shipping_1() ,
> form='_checkout_shipping__print' , post_only=True )
> def _checkout_shipping__submit(self):
>         try:
>                 raise SubmissionError('Whatever')
>         except SubmissionError , e :
>                 h.formerrors_set( message='!!!' )
>                 return osn_form_reprint( self , '_checkout_shipping__print' )
>         except :
>                 raise

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to