App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
google.appengine.api.validation.Validator Class Reference
Inheritance diagram for google.appengine.api.validation.Validator:
google.appengine.api.conf._Scalar google.appengine.api.conf._ValidParameterName google.appengine.api.croninfo.GrocValidator google.appengine.api.croninfo.TimezoneValidator google.appengine.api.dispatchinfo.DispatchEntryURLValidator google.appengine.api.dosinfo.SubnetValidator google.appengine.api.validation.Optional google.appengine.api.validation.Options google.appengine.api.validation.Range google.appengine.api.validation.Regex google.appengine.api.validation.RegexStr google.appengine.api.validation.Repeated google.appengine.api.validation.TimeValue google.appengine.api.validation.Type

Public Member Functions

def __init__
 
def __call__
 
def Validate
 
def ToValue
 

Public Attributes

 default
 

Static Public Attributes

 expected_type = object
 

Detailed Description

Validator base class.

Though any callable can be used as a validator, this class encapsulates the
case when a specific validator needs to hold a particular state or
configuration.

To implement Validator sub-class, override the validate method.

This class is permitted to change the ultimate value that is set to the
attribute if there is a reasonable way to perform the conversion.

Constructor & Destructor Documentation

def google.appengine.api.validation.Validator.__init__ (   self,
  default = None 
)
Constructor.

Args:
  default: Default assignment is made during initialization and will
not pass through validation.

Member Function Documentation

def google.appengine.api.validation.Validator.__call__ (   self,
  value,
  key = '???' 
)
Main interface to validator is call mechanism.
def google.appengine.api.validation.Validator.ToValue (   self,
  value 
)
Convert 'value' to a simplified collection or basic type.

Subclasses of Validator should override this method when the dumped
representation of 'value' is not simply <type>(value) (e.g. a regex).

Args:
  value: An object of the same type that was returned from Validate().

Returns:
  An instance of a builtin type (e.g. int, str, dict, etc).  By default
  it returns 'value' unmodified.
def google.appengine.api.validation.Validator.Validate (   self,
  value,
  key = '???' 
)
Override this method to customize sub-class behavior.

Args:
  value: Value to validate.
  key: Name of the field being validated.

Returns:
  Value if value is valid, or a valid representation of value.

The documentation for this class was generated from the following file: