Lukasz Szybalski schrieb: > On Fri, Mar 27, 2009 at 3:42 PM, Lukasz Szybalski <[email protected]> wrote: >> Hello, >> I have a addressbook.py in my controller folder, >> >> I then import the widget class, and its instance. I use it for one of >> the functions but when validation suppose to happen I get: >> >> ile >> '/home/l...../tg2rc1env/lib/python2.5/site-packages/TurboGears2-2.0rc1.-py2.5.egg/tg/controllers.py', >> line 372 in _handle_validation_errors >> output = error_handler(controller.im_self, *remainder, **dict(params)) >> TypeError: addressbook() got an unexpected keyword argument 'contact_name' >> >> > > forgot to mention: > > from xxx.controllers.addressbook import address_form, AddressForm > > @expose('xxxx.templates.index') > def index(self): > """Handle the front-page.""" > return dict(page='index') > @expose('xxx.templates.addressbook') > def addressbook(self): > """Handle the Addressbook.""" > pylons.c.address_form = address_form > return dict(page='addressbook') > > @validate(address_form, error_handler=addressbook) > @expose() > def saveaddress(self, **kw): > ....
The error-message is pretty clear I'd say - an error-handler gets passed all the form parameters as well. The easiest fix would be to add a **kw-catch-all to addressbook() Diez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

