formencode.htmlfill_schemabuilder – Read a Schema from an HTML Form

Extension to htmlfill that can parse out schema-defining statements.

You can either pass SchemaBuilder to htmlfill.render (the listen argument), or call parse_schema to just parse out a Schema object.

Module Contents

formencode.htmlfill_schemabuilder.parse_schema(form)

Given an HTML form, parse out the schema defined in it and return that schema.

SchemaBuilder(validators={'requireifmissing': <class 'formencode.validators.RequireIfMissing'>, 'nodefault': <class 'formencode.api.NoDefault'>, 'datetime_isotime': <function datetime_isotime at 0x31ffc80>, 'iphonenumbervalidator': <function IPhoneNumberValidator at 0x32eb6e0>, 'constant': <class 'formencode.validators.Constant'>, 'rangevalidator': <class 'formencode.validators.RangeValidator'>, 'datetime_makedate': <function datetime_makedate at 0x31ffb90>, 'int': <class 'formencode.validators.Int'>, 'attribute': <class 'formencode.interfaces.Attribute'>, 'stateprovince': <function StateProvince at 0x31ffcf8>, 'random': None, 'number': <class 'formencode.validators.Number'>, 're': <module 're' from '/home/docs/checkouts/readthedocs.org/user_builds/formencode/envs/1.2.6/lib/python2.7/re.pyc'>, 'datetime_time': <function datetime_time at 0x31ffc08>, 'postalcode': <function PostalCode at 0x32eb758>, 'ischema': <class 'formencode.interfaces.ISchema'>, 'phonenumber': <function PhoneNumber at 0x32eb668>, 'fieldsmatch': <class 'formencode.validators.FieldsMatch'>, 'filters': [('ignore', <_sre.SRE_Pattern object at 0x2f66b10>, <type 'exceptions.DeprecationWarning'>, <_sre.SRE_Pattern object at 0x311f920>, 0), ('ignore', <_sre.SRE_Pattern object at 0x27c3468>, <type 'exceptions.DeprecationWarning'>, <_sre.SRE_Pattern object at 0x278a1a0>, 0), ('ignore', <_sre.SRE_Pattern object at 0x26bd3d0>, <type 'exceptions.DeprecationWarning'>, <_sre.SRE_Pattern object at 0x2703ba0>, 0), ('ignore', None, <type 'exceptions.DeprecationWarning'>, None, 0), ('ignore', None, <type 'exceptions.PendingDeprecationWarning'>, None, 0), ('ignore', None, <type 'exceptions.ImportWarning'>, None, 0), ('ignore', None, <type 'exceptions.BytesWarning'>, None, 0)], 'validators': <function validators at 0x32e85f0>, 'timeconverter': <class 'formencode.validators.TimeConverter'>, 'locale': <module 'locale' from '/home/docs/checkouts/readthedocs.org/user_builds/formencode/envs/1.2.6/lib/python2.7/locale.pyc'>, 'datevalidator': <class 'formencode.validators.DateValidator'>, 'stripfield': <class 'formencode.validators.StripField'>, 'mxdatetime_module': None, 'fileuploadkeeper': <class 'formencode.validators.FileUploadKeeper'>, 'regex': <class 'formencode.validators.Regex'>, 'xri': <class 'formencode.validators.XRI'>, 'datetime_now': <function datetime_now at 0x31ffb18>, '__all__': ['Invalid', 'Regex', 'FieldsMatch', 'TimeConverter', 'OpenId', 'IndexListConverter', 'OneOf', 'Number', 'ConfirmType', 'Bool', 'PlainText', 'DateValidator', 'Email', 'FieldStorageUploadConverter', 'String', 'CreditCardSecurityCode', 'DictConverter', 'CreditCardExpires', 'StripField', 'URL', 'CreditCardValidator', 'Empty', 'FormValidator', 'Set', 'IPAddress', 'FileUploadKeeper', 'XRI', 'RangeValidator', 'RequireIfMissing', 'StringBool', 'StringBoolean', 'Wrapper', 'CIDR', 'RequireIfPresent', 'Constant', 'NotEmpty', 'MACAddress', 'Int', 'SignedString', 'MinLength', 'DateConverter', 'FancyValidator', 'Validator', 'MaxLength', 'UnicodeString'], 'dictconverter': <class 'formencode.validators.DictConverter'>, 'minlength': <class 'formencode.validators.MinLength'>, 'warnings': <module 'warnings' from '/home/docs/checkouts/readthedocs.org/user_builds/formencode/envs/1.2.6/lib/python2.7/warnings.pyc'>, 'invalid': <class 'formencode.api.Invalid'>, '__package__': 'formencode', 'fancyvalidator': <class 'formencode.api.FancyValidator'>, 'indexlistconverter': <class 'formencode.validators.IndexListConverter'>, 'bool': <class 'formencode.validators.Bool'>, '_': <function <lambda> at 0x31ffa28>, 'formvalidator': <class 'formencode.validators.FormValidator'>, 'set': <class 'formencode.validators.Set'>, 'email': <class 'formencode.validators.Email'>, 'empty': <class 'formencode.validators.Empty'>, 'ivalidator': <class 'formencode.interfaces.IValidator'>, 'cgi': <module 'cgi' from '/usr/lib/python2.7/cgi.pyc'>, 'openid': <class 'formencode.validators.OpenId'>, 'oneof': <class 'formencode.validators.OneOf'>, 'wrapper': <class 'formencode.validators.Wrapper'>, 'string': <class 'formencode.validators.String'>, 'datetime_module': None, '__builtins__': {'bytearray': <type 'bytearray'>, 'IndexError': <type 'exceptions.IndexError'>, 'all': <built-in function all>, 'help': Type help() for interactive help, or help(object) for help about object., 'vars': <built-in function vars>, 'SyntaxError': <type 'exceptions.SyntaxError'>, 'unicode': <type 'unicode'>, 'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'memoryview': <type 'memoryview'>, 'isinstance': <built-in function isinstance>, 'copyright': Copyright (c) 2001-2012 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'NameError': <type 'exceptions.NameError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'dict': <type 'dict'>, 'input': <built-in function input>, 'oct': <built-in function oct>, 'bin': <built-in function bin>, 'SystemExit': <type 'exceptions.SystemExit'>, 'StandardError': <type 'exceptions.StandardError'>, 'format': <built-in function format>, 'repr': <built-in function repr>, 'sorted': <built-in function sorted>, 'False': False, 'RuntimeWarning': <type 'exceptions.RuntimeWarning'>, 'list': <type 'list'>, 'iter': <built-in function iter>, 'reload': <built-in function reload>, 'Warning': <type 'exceptions.Warning'>, '__package__': None, 'round': <built-in function round>, 'dir': <built-in function dir>, 'cmp': <built-in function cmp>, 'set': <type 'set'>, 'bytes': <type 'str'>, 'reduce': <built-in function reduce>, 'intern': <built-in function intern>, 'issubclass': <built-in function issubclass>, 'Ellipsis': Ellipsis, 'EOFError': <type 'exceptions.EOFError'>, 'locals': <built-in function locals>, 'BufferError': <type 'exceptions.BufferError'>, 'slice': <type 'slice'>, 'FloatingPointError': <type 'exceptions.FloatingPointError'>, 'sum': <built-in function sum>, 'getattr': <built-in function getattr>, 'abs': <built-in function abs>, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'print': <built-in function print>, 'True': True, 'FutureWarning': <type 'exceptions.FutureWarning'>, 'ImportWarning': <type 'exceptions.ImportWarning'>, 'None': None, 'hash': <built-in function hash>, 'ReferenceError': <type 'exceptions.ReferenceError'>, 'len': <built-in function len>, 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information., 'frozenset': <type 'frozenset'>, '__name__': '__builtin__', 'ord': <built-in function ord>, 'super': <type 'super'>, 'TypeError': <type 'exceptions.TypeError'>, 'license': See http://www.python.org/2.7/license.html, 'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>, 'UserWarning': <type 'exceptions.UserWarning'>, 'filter': <built-in function filter>, 'range': <built-in function range>, 'staticmethod': <type 'staticmethod'>, 'SystemError': <type 'exceptions.SystemError'>, 'BaseException': <type 'exceptions.BaseException'>, 'pow': <built-in function pow>, 'RuntimeError': <type 'exceptions.RuntimeError'>, 'float': <type 'float'>, 'MemoryError': <type 'exceptions.MemoryError'>, 'StopIteration': <type 'exceptions.StopIteration'>, 'globals': <built-in function globals>, 'divmod': <built-in function divmod>, 'enumerate': <type 'enumerate'>, 'apply': <built-in function apply>, 'LookupError': <type 'exceptions.LookupError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'basestring': <type 'basestring'>, 'UnicodeError': <type 'exceptions.UnicodeError'>, 'zip': <built-in function zip>, 'hex': <built-in function hex>, 'long': <type 'long'>, 'next': <built-in function next>, 'ImportError': <type 'exceptions.ImportError'>, 'chr': <built-in function chr>, 'xrange': <type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built-in functions, exceptions, and other objects.nnNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", 'Exception': <type 'exceptions.Exception'>, 'tuple': <type 'tuple'>, 'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>, 'reversed': <type 'reversed'>, 'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>, 'IOError': <type 'exceptions.IOError'>, 'hasattr': <built-in function hasattr>, 'delattr': <built-in function delattr>, 'setattr': <built-in function setattr>, 'raw_input': <built-in function raw_input>, 'SyntaxWarning': <type 'exceptions.SyntaxWarning'>, 'compile': <built-in function compile>, 'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'str': <type 'str'>, 'property': <type 'property'>, 'GeneratorExit': <type 'exceptions.GeneratorExit'>, 'int': <type 'int'>, '__import__': <built-in function __import__>, 'KeyError': <type 'exceptions.KeyError'>, 'coerce': <built-in function coerce>, 'PendingDeprecationWarning': <type 'exceptions.PendingDeprecationWarning'>, 'file': <type 'file'>, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'unichr': <built-in function unichr>, 'id': <built-in function id>, 'OSError': <type 'exceptions.OSError'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'min': <built-in function min>, 'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'execfile': <built-in function execfile>, 'any': <built-in function any>, 'complex': <type 'complex'>, 'bool': <type 'bool'>, 'ValueError': <type 'exceptions.ValueError'>, 'NotImplemented': NotImplemented, 'map': <built-in function map>, 'buffer': <type 'buffer'>, 'max': <built-in function max>, 'object': <type 'object'>, 'TabError': <type 'exceptions.TabError'>, 'callable': <built-in function callable>, 'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, 'eval': <built-in function eval>, '__debug__': True, 'IndentationError': <type 'exceptions.IndentationError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'classmethod': <type 'classmethod'>, 'UnboundLocalError': <type 'exceptions.UnboundLocalError'>, 'NotImplementedError': <type 'exceptions.NotImplementedError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'OverflowError': <type 'exceptions.OverflowError'>}, 'stringbool': <class 'formencode.validators.StringBool'>, '__file__': '/var/build/user_builds/formencode/checkouts/1.2.6/formencode/validators.py', 'stringboolean': <class 'formencode.validators.StringBool'>, 'httplib': None, 'sha1': None, 'plaintext': <class 'formencode.validators.PlainText'>, 'creditcardvalidator': <class 'formencode.validators.CreditCardValidator'>, 'confirmtype': <class 'formencode.validators.ConfirmType'>, '__doc__': 'nValidator/Converters for use with FormEncode.n', 'socket': None, 'is_validator': <function is_validator at 0x32edd70>, 'interface': <class 'formencode.interfaces.Interface'>, '__name__': 'formencode.validators', 'cidr': <class 'formencode.validators.CIDR'>, 'ipaddress': <class 'formencode.validators.IPAddress'>, 'identity': validators.Identity, 'ideclarative': <class 'formencode.interfaces.IDeclarative'>, 'macaddress': <class 'formencode.validators.MACAddress'>, 'have_dns': False, 'fieldstorageuploadconverter': <class 'formencode.validators.FieldStorageUploadConverter'>, 'notempty': <class 'formencode.validators.NotEmpty'>, 'creditcardsecuritycode': <class 'formencode.validators.CreditCardSecurityCode'>, 'signedstring': <class 'formencode.validators.SignedString'>, 'url': <class 'formencode.validators.URL'>, 'creditcardexpires': <class 'formencode.validators.CreditCardExpires'>, 'is_empty': <function is_empty at 0x32edcf8>, 'dateconverter': <class 'formencode.validators.DateConverter'>, 'urlparse': None, 'validator': <class 'formencode.api.Validator'>, 'maxlength': <class 'formencode.validators.MaxLength'>, 'unicodestring': <class 'formencode.validators.UnicodeString'>, 'requireifpresent': <class 'formencode.validators.RequireIfMissing'>, 'import_datetime': <function import_datetime at 0x31ffaa0>})

Project Versions

Table Of Contents

Previous topic

formencode.htmlfill – Fill in HTML forms

Next topic

formencode.htmlgen – Convenient building of ElementTree nodes

This Page