turbogears :: validators :: Schema :: Class Schema

Class Schema

source code

                        object --+                
                                 |                
formencode.declarative.Declarative --+            
                                     |            
              formencode.api.Validator --+        
                                         |        
             formencode.api.FancyValidator --+    
                                             |    
                      formencode.schema.Schema --+
                                                 |
                                                Schema

Modified Schema validator for TurboGears.

A schema validates a dictionary of values, applying different validators (by key) to the different values.

This modified Schema allows fields that do not appear in the fields parameter of your schema, but filters them out from the value dictionary. You might want to set filter_extra_fields to True when you're building a dynamic form with unpredictable keys and need these values.

Nested Classes

Inherited from formencode.api.FancyValidator: if_empty, if_invalid, if_invalid_python

Inherited from formencode.api.Validator: if_missing

Inherited from formencode.declarative.Declarative: __metaclass__

Instance Methods
 
from_python(self, value, state=None) source code

Inherited from formencode.schema.Schema: __initargs__, add_chained_validator, add_field, add_pre_validator, assert_dict, empty_value, is_empty, subvalidators

Inherited from formencode.api.FancyValidator: assert_string, base64encode, to_python

Inherited from formencode.api.Validator: __init__, all_messages, message

Inherited from formencode.declarative.Declarative: __call__, __repr__, __sourcerepr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods

Inherited from formencode.declarative.Declarative: __classsourcerepr__, singleton

Static Methods

Inherited from formencode.schema.Schema: __classinit__

Class Variables
  filter_extra_fields = True
hash(x)
  allow_extra_fields = True
hash(x)
  if_key_missing = None
hash(x)

Inherited from formencode.schema.Schema: __mutableattributes__, accept_iterator, chained_validators, compound, fields, ignore_key_missing, messages, order, pre_validators

Inherited from formencode.api.FancyValidator: accept_python, not_empty, strip

Inherited from formencode.api.Validator: __singletonmethods__, gettextargs, repeating, use_builtins_gettext

Inherited from formencode.declarative.Declarative: __unpackargs__, counter

Properties

Inherited from object: __class__

Method Details

from_python(self, value, state=None)

source code 
Overrides: formencode.api.Validator.from_python