At this point I am very confused I am trying to use formencode with Pyramid
all the validators are working except Email

form.py
----------------------
import formencode
from formencode import Schema, validators

class NewClient(Schema):
    filter_extra_fields = True
    allow_extra_fields = True

    height_feet = validators.String(not_empty=True)
    height_inch = validators.String(not_empty=True)
    cweight = validators.Int(not_empty=True)
    tweight = validators.Int(not_empty=True)
    gender = validators.String(not_empty=True)
    fname = validators.String(not_empty=True)
    age = validators.Int(not_empty=True)
    cmail = validators.Email(not_empty=True),  # Have no idea why this is
not working or being called when left blank
    pgoal = validators.String(not_empty=True)
    phone = validators.String(not_empty=True)
-------------------

views.py
------------------
def new_client(request):
    from forms import NewClient
    from pyramid_simpleform import Form
    from pyramid_simpleform.renderers import FormRenderer

    form = Form(request, schema=NewClient)
    if form.validate():
        details['valid'] = True

    return dict(newclient=details, form=FormRenderer(form))
------------------

Now when I submit the form all validation is working except for the cmail, I
can leave it blank, add something that isn't a email address and it never
returns invalid. Is there a bug in the code or am I missing something
simple?

-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com

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