Hey everyone,

I am trying to use a formencode Schema to validate a compound field.
Basically I have this:


class BaseForm(formencode.Schema):
    allow_extra_fields = True
    filter_extra_fields = True

class AddSubmitterForm(BaseForm):
    first_name = formencode.validators.String(not_empty = True)
    last_name = formencode.validators.String(not_empty = True)
    phone = formencode.validators.PhoneNumber(not_empty = True)
    email = formencode.validators.Email(not_empty = True)



I just want to ensure that the first_name AND the last_name are
unique. So if 'Todd Johnson' is in the database already and I try to
add 'Todd Johnson' it will not validate, but if I try to add 'Todd
Smith' or 'Bob Johnson' that will validate.

This is my first attempt at using formencode so I figure this is an
elementary question, but I couldn't quite figure it out. Thanks in
advance for your time and your help.

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