**kw needs to be last (a Python limitation, see keyword arguements).
Cheers,
Simon
Arnold wrote:
> Thank you Simon,
>
> I replaced the names like this : def validation_error(self, tg_source,
> **kw, tg_errors):
> The fundamental change is **kw instead of kw, but I get an error at
> server launch:
>
> def validation_error(self, tg_source, **kw, tg_errors):
> ^
> SyntaxError: invalid syntax
>
> I believe that tg_source, **kw, tg_errors are names in calling
> program.
> Have you a short code example ?
> Thanks again
> Arnold
>
>
> Simon Belak wrote:
>> Arnold wrote:
>>> I can't get the form parameters that go through the validator. My code:
>>>
>>> @turbogears.expose(html="newgears.templates.confirmation")
>>> @turbogears.validate(validators={ "mailAdress" : validators.Email()})
>>>
>>> ...
>>>
>>> def validation_error(self, funcname, kw, errors):
>>>
>>> When the email is invalid, validation_error is correctly called but kw
>>> is empty : {}
>>>
>>> I guess my code is wrong ! Any clue appreciated
>>> Arnold
>> If the above is actual code, you have your argument names wrong. Try
>>
>> funcname -> tg_source
>> errors -> tg_errors
>> kw -> **kw
>>
>> Cheers,
>> Simon
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---