Ñò
†°Ic @ s d d k Td d k Td d k l Z d d k Z d g Z d e f d „ ƒ YZ d d „ Z d „ Z d „ Z d
„ Z
d e f d „ ƒ YZ d S(
iÿÿÿÿ( t *( t _Nt Schemac B s e Z d Z g Z g Z e Z e Z e Z e Z
e Z h Z
g Z h e d ƒ d 6e d ƒ d 6e d ƒ d 6Z d Z d
„ Z d „ Z d „ Z d
„ Z d „ Z d „ Z e i e ƒ Z d „ Z e i e ƒ Z d „ Z e i e ƒ Z d „ Z d „ Z d „ Z RS( sG
A schema validates a dictionary of values, applying different
validators (be key) to the different values. If
allow_extra_fields=True, keys without validators will be allowed;
otherwise they will raise Invalid. If filter_extra_fields is
set to true, then extra fields are not passed back in the results.
Validators are associated with keys either with a class syntax, or
as keyword arguments (class syntax is usually easier). Something
like::
class MySchema(Schema):
name = Validators.PlainText()
phone = Validators.PhoneNumber()
These will not be available as actual instance variables, but will
be collected in a dictionary. To remove a validator in a subclass
that is present in a superclass, set it to None, like::
class MySubSchema(MySchema):
name = None
Note that missing fields are handled at the Schema level. Missing
fields can have the 'missing' message set to specify the error
message, or if that does not exist the *schema* message
'missingValue' is used.
s* The input field %(name)s was not expected.t notExpecteds
Missing valuet missingValues7 The input must be dict-like (not a %(type)s: %(value)r)t badDictTypet fieldst chained_validatorst pre_validatorsc C sÙ t i | | ƒ | i t f j o | Sxz | i ƒ D]l \ } } | d j o q5 n t | ƒ o | | i |