Passing state when using decorators (formencode)
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? Thanks a lot, Francesco -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
Re: Passing state when using decorators (formencode)
On Tue, Apr 20, 2010 at 7:01 AM, astroboy e.imho...@gmail.com wrote: 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? No, that's a limitation of the @validate decorator. Calling .to_python yourself in the action is the way to go. We looked into splitting up @validate to make it more flexible but it was too much work for Pylons 1.0. The following ticket outlines some ideas that may be taken up in later versions. http://pylonshq.com/project/pylonshq/ticket/405 -- Mike Orr sluggos...@gmail.com -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
Re: Passing state when using decorators (formencode)
Ok, thanks for the answer. I was going crazy trying to do that. On Apr 20, 6:11 pm, Mike Orr sluggos...@gmail.com wrote: On Tue, Apr 20, 2010 at 7:01 AM, astroboy e.imho...@gmail.com wrote: 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? No, that's a limitation of the @validate decorator. Calling .to_python yourself in the action is the way to go. We looked into splitting up @validate to make it more flexible but it was too much work for Pylons 1.0. The following ticket outlines some ideas that may be taken up in later versions. http://pylonshq.com/project/pylonshq/ticket/405 -- Mike Orr sluggos...@gmail.com -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/pylons-discuss?hl=en. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.