The python 2.3 pseudo-decorator syntax does not work with error_handler.
The code:
[expose(template="sysiphus.templates.results")]
[validate(form=search_form)]
[error_handler(index)]
def search(self, address=''):
return dict(form=search_form)
produces the error:
...
File "/usr/lib/python2.3/site-packages/TurboGears-1.0-py2.3.egg/turbogears/controllers.py", line 173, in validate
return errorhandling.run_with_errors(errors, func, *args, **kw)
File "/usr/lib/python2.3/site-packages/TurboGears-1.0-py2.3.egg/turbogears/errorhandling.py", line 110, in run_with_errors
raise NotImplementedError("Method %s.%s() has no applicable "
NotImplementedError: Method Root.search() has no applicable error handler.
But adding the more normal python 2.3 validator syntax:
search=error_handler(index)(search)
works. In both cases the signature for index is:
[expose(template="sysiphus.templates.index")]
def index(self, address='', tg_errors=None):