Unless I have missed the subtlety ...

The index method gets passed 'tg_errors'.

AJ

On May 4, 9:13 pm, W-Mark Kubacki <[EMAIL PROTECTED]> wrote:
> Hi group,
>
> my issue might sound familiar to you, but there is a subtle difference
> in what has previously been posted to this list (which I have searched
> throught, of course).
>
> I cannot figure out how to display error messages in a Form which gets
> validated by Schema.
>
> I have separated the entirety in a Form, WidgetsList and Schema. The
> Form itself utilizies field_for(), error_for() and so on.
>
> This works as expected (error messages get displayed):
>     @tg.expose(...)
>     def index(self):
>         return dict(form=myform)
>
>     @tg.expose(...)
>     @tg.error_handler(index)
>     @tg.validate(form=myform)
>     def new(self, **kwargs)
>         ...
>
> And this doesn't work as the above:
>     @tg.expose(...)
>     def index(self):
>         return dict(form=myform)
>
>     @tg.expose(...)
>     @tg.error_handler(index)
>     @tg.validate(validators=MyFormValidationSchema())  # difference!
>     def new(self, **kwargs)
>         ...
>
> What must one do to modify the second example to behave like the first
> still using a Schema? Are there any hidden variables to set? Does have
> error_handler some more parameters?
>   I know I can access the error messages by tg_errors, but how to tell
> the form about it?
>
> Thanks in advance
> W-Mark Kubacki
>
> --
> Already 
> read:http://docs.turbogears.org/1.0/SimpleWidgetFormhttp://docs.turbogears.org/1.0/ValidateDecoratorhttp://docs.turbogears.org/1.0/ErrorHandling
>
>  smime.p7s
> 5KDownload


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