Hi, Everyone! Some parts of validation-related docs are unclear for me: http://pylonshq.com/docs/en/1.0/forms/#validation-the-long-way Here we instantiate "schema = EmailForm()" for each request. Various code examples in The Pylons Book also follows this practice.
The schema doesn't modify any shared object, does it? So why should we do this? The same questions applies to other FormEncode primitives - single validators, compound validators (ForEach()) and chained validators. The official documentation says (http://formencode.org/ Validator.html#other-validator-usage): "Validators use instance variables to store their customization information. You can use either subclassing or normal instantiation to set these... ...You can actually use classes most places where you could use an instance; .to_python() and .from_python() will create instances as necessary, and many other methods are available on both the instance and the class level." As I understand this part, we can create an instance of a schema (or any other validation primitive) in the global scope of process and then use it in any thread for form validation, right? So, I'm a little confused here... please clarify this use case. Thanks! :) -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
