Success!

On Jan 21, 2008 3:50 PM, Alberto Valverde <[EMAIL PROTECTED]> wrote:
> Try:
>
> @validate(form=myForm, error_handler=ask)

Well, this doesn't work in tg2:

    @validate(form=myForm, error_handler=ask)

  File "/home/catherine/tg2/val/val/controllers/root.py", line 20, in
RootController
    @validate(form=myForm, error_handler=ask)
TypeError: __init__() got an unexpected keyword argument 'form'

(which is why I went poking around for alternate syntaxes, eventually
trying the validators=myForm.validators)

But, it turns out that if I call it like this:

    @validate(myForm, error_handler=ask)

... it works!  Error messages and everything, like it's supposed to.

On Jan 21, 2008 4:17 PM, Lukasz Szybalski <[EMAIL PROTECTED]> wrote:
> shouldn't this be :
>
>    def acknowledge(self, **kwargs):
>          return 'Your integer was: ' + str(kwargs['integerplease'])

Sure, if I wanted to make sure I could accept any arguments even if I
add fields, but for this example I didn't care.

Thanks, everybody!
-- 
- Catherine
http://catherinedevlin.blogspot.com/
*** PyCon 2008 * Chicago * March 13-20 * us.pycon.org ***

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to