开发者

Passing state when using decorators (formencode) in pylons

开发者 https://www.devze.com 2023-01-16 04:34 出处:网络
I\'ve met the same problem as this page: http://www.mail-archive.com/pylons-discuss@googlegroups.com/msg14292.html

I've met the same problem as this page:

http://www.mail-archive.com/pylons-discuss@googlegroups.com/msg14292.html

This is the main content from there:

I am using formencode to validate my forms, and I've stumbled upon a problem. When using tha validator inside the controller action,开发者_运维问答 I call to_python() and I can pass the state variable with any information I need to the validators. Is it possible to do the same with the validate decorator?

From the answers of there, they said it has not been fixed in pylons, but that was several months agao. I wanna if there any solutions for it now?


pylons.decorators.validate(schema=None, validators=None, form=None, variable_decode=False, dict_char='.', list_char='-', post_only=True, state=None, on_get=False, **htmlfill_kwargs)

Note the state parameter. Full docs here (Pylons 1.0)

0

精彩评论

暂无评论...
验证码 换一张
取 消