On Sat, Aug 4, 2012 at 7:59 AM, alex bodnaru <[email protected]>wrote:
> all i wanted is to save the tmpl_context.form_errors in the request
> object, and
> raise an exception. this would better be done from basecontroller.
> this exception would later trigger /error/document, which i've patched to
> display this error.
> since this is a quite routine job, won't this be something to do in only
> one place?
>
Okay, that makes sense, and now I have an answer for how I would do it:
In BaseController, add the following code in the __call__ method:
if hasattr(tmpl_context, 'form_errors'):
request.form_errors = templ_context.form_errors
raise Exception('change to your exception here')
--
Michael J. Pedersen
My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
Google Talk: [email protected] -- Twitter: pedersentg
--
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.