Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Very Confused: formencode.validators.Email
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bruce Wade  
View profile  
 More options Jul 3 2011, 2:07 pm
From: Bruce Wade <bruce.w...@gmail.com>
Date: Sun, 3 Jul 2011 11:07:42 -0700
Local: Sun, Jul 3 2011 2:07 pm
Subject: Very Confused: formencode.validators.Email

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Detectedstealth  
View profile  
 More options Jul 5 2011, 12:09 am
From: Detectedstealth <bruce.w...@gmail.com>
Date: Mon, 4 Jul 2011 21:09:40 -0700 (PDT)
Local: Tues, Jul 5 2011 12:09 am
Subject: Re: Very Confused: formencode.validators.Email
Nevermind I found my typo the , at the end of that validation:
cmail = validators.Email(not_empty=True),

Apparently that causes the validation to be ignored :D

On Jul 3, 11:07 am, Bruce Wade <bruce.w...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Re : Re: Very Confused: formencode.validators.Email" by Georges Dubus
Georges Dubus  
View profile  
 More options Jul 5 2011, 3:55 am
From: Georges Dubus <georges.du...@compiletoi.net>
Date: Tue, 5 Jul 2011 00:55:44 -0700 (PDT)
Local: Tues, Jul 5 2011 3:55 am
Subject: Re : Re: Very Confused: formencode.validators.Email

After the line
cmail = validators.Email(not_empty=True),

The value of cmail is (validators.Email(not_empty=True),) : it's a tuple.
That's why it's ignored during the validation.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »