Base class for all validated objects.
def google.appengine.api.validation.ValidatedBase.CheckInitialized |
( |
|
self | ) |
|
Checks that all required fields are initialized.
This function is called after all attributes have been checked to
verify any higher level constraints, for example ensuring all required
attributes are present.
Subclasses should override this function and raise an exception for
any errors.
def google.appengine.api.validation.ValidatedBase.GetValidator |
( |
|
self, |
|
|
|
key |
|
) |
| |
Safely get the Validator corresponding to the given key.
This function should be overridden by subclasses
Args:
key: The attribute or item to get a validator for.
Returns:
Validator associated with key or attribute.
Raises:
ValidationError: if the requested key is illegal.
def google.appengine.api.validation.ValidatedBase.Set |
( |
|
self, |
|
|
|
key, |
|
|
|
value |
|
) |
| |
Set a single value on Validated instance.
This method should be overridded by sub-classes.
This method can only be used to assign validated attributes/items.
Args:
key: The name of the attributes
value: The value to set
Raises:
ValidationError: when no validated attribute exists on class.
def google.appengine.api.validation.ValidatedBase.SetMultiple |
( |
|
self, |
|
|
|
attributes |
|
) |
| |
Set multiple values on Validated instance.
All attributes will be validated before being set.
Args:
attributes: A dict of attributes/items to set.
Raises:
ValidationError: when no validated attribute exists on class.
def google.appengine.api.validation.ValidatedBase.ToDict |
( |
|
self | ) |
|
Convert ValidatedBase object to a dictionary.
Recursively traverses all of its elements and converts everything to
simplified collections.
Subclasses should override this method.
Returns:
A dictionary mapping all attributes to simple values or collections.
def google.appengine.api.validation.ValidatedBase.ToYAML |
( |
|
self | ) |
|
Print validated object as simplified YAML.
Returns:
Object as a simplified YAML string compatible with parsing using the
SafeLoader.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/api/validation.py