View source on GitHub |
Wrap various types as instances of a validator.
google.appengine.api.validation.AsValidator(
validator
)
Used to allow shorthand for common validator types. It converts the following types to the following Validators:
- strings -> Regex
- type -> Type
- collection -> Options
- Validator -> Itself
Args | |
---|---|
validator
|
Object to wrap in a validator. |
Returns | |
---|---|
Validator instance that wraps the given value. |
Raises | |
---|---|
AttributeDefinitionError
|
If validator is not one of the above described
types.
|