FormEncode Email Address validation schema

/ Published in: Python
Save to your folder(s)

model/ is a good place to put schemata in a pylons app: easy to build with inheritance and accessible to controllers via model.form.EmailForm, etc. See the link for further info on the _extra_fields options -- this one is intended for just two fields: a text field and submit button.

Copy this code and paste it in your HTML
  1. import formencode
  3. class EmailForm(formencode.Schema):
  4. allow_extra_fields = True
  5. filter_extra_fields = True
  6. email = formencode.validators.Email(not_empty=True)


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.