replacing:

@validate(form=movie_form, error_handler=index)

with:

@validate(form=movie_form, error_handler='index')

Allows validation to work as expected.  Since error_handler as
specified in the decorator is a function, it is rather obvious why it
fails.

file tw/mods/pylonshf.py (0.9.8-py2.5), line 62:

            if error_handler:
                environ = pylons.request.environ
                environ['REQUEST_METHOD'] = 'GET'
                environ['pylons.routes_dict']['action'] =
error_handler
                return self._dispatch_call()

In order for the code to work properly by passing a function name to
error_handler in the decorator, I would need to change the above to:

            if error_handler:
                environ = pylons.request.environ
                environ['REQUEST_METHOD'] = 'GET'
                environ['pylons.routes_dict']['action'] =
error_handler.__name__
                return self._dispatch_call()

I'll post this on toscawidgets-discuss.

Graham, can you check your pylonshf.py and see if this section is the
same in your installation?

Mike, thank you for the pointers in the right direction.  Once I had a
few minutes to sit down and really figure out what it was doing, the
answer was somewhat obvious.
--~--~---------~--~----~------------~-------~--~----~
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