On Nov 10, 2006, at 5:38 AM, derek wrote:

> I have got stuck at one point in the form validation example:
> http://pylonshq.com/docs/0.9.3/form_handling.html
>
> I am not sure where to save the validation schema code - currently it
> is saved in modes/form.py
>
> However, when I run the app, I get a :
> @validate(schema=EmailForm(), form='form')
> exceptions.NameError: name 'EmailForm' is not defined
> error.
>
> Where do I store the form validation schema code, and how do I
> reference it elsewhere?

I generally consider form validation schema's to be 'model's, so I  
make a forms.py module inside the models/ directory. If you put your  
EmailForm schema in there, and named it 'Email', then you'd have:
@validate(schema=model.form.Email(), form='form')

HTH,
Ben

--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to