In the example (http://wiki.pylonshq.com/display/pylonsdocs/Form
+Handling) there is this piece of code:

    def form(self):
        return render('/form.mako')

    @validate(schema=EmailForm(), form='form')
    def email(self):
        return 'Your email is: %s' % self.form_result.get('email')

What would be the correct way of using @validate decorator to display
error messages in form.mako?

You can not simply include "<form:error ...>" fields to form.mako,
since when action 'form' is called with normal GET request, the
invalid "<form:error ...>" (in the html context) tags are a part of
the output. Also, you cannot call htmlfill.render(render('/
form.mako')), since @validate decorator calls this 'form' action and
will get output with "<form:error ...>" tags already removed.

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