Matt Wilson schrieb:
> I attached a validators.NotEmpty() to one of my forms, and now when
> the form is submitted with invalid data, I get a 500 immediately.
> However, I would like to catch these invalid submits and redirect back
> to the form page.
> 
> How to do this?

Add a "tg_errors" keyword argument to your controller method:

@expose()
@validate(validators=...)
def foo(self, arg1, arg2, tg_errors=None):
    ...

See http://docs.turbogears.org/1.0/ValidateDecorator#id2

Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to