views:

29

answers:

1

I've met the same problem as this page:

http://www.mail-archive.com/[email protected]/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?

+1  A: 
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)

Ben
After some searchs, I found there are some limitations with validation decorator, we can't pass dynamic state to it (via @validate). Instead, we can only invoke it as a method, but which looks not as good as decorator
Freewind