![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | Validate |
![]() | |
def | __init__ |
def | __call__ |
def | Validate |
def | ToValue |
Public Attributes | |
options | |
![]() | |
default | |
Additional Inherited Members | |
![]() | |
expected_type = object | |
Limit field based on pre-determined values. Options are used to make sure an enumerated set of values are the only one permitted for assignment. It is possible to define aliases which map multiple string values to a single original. An example of usage: class ZooAnimal(validated.Class): ATTRIBUTES = { 'name': str, 'kind': Options('platypus', # No aliases ('rhinoceros', ['rhino']), # One alias ('canine', ('dog', 'puppy')), # Two aliases )
def google.appengine.api.validation.Options.__init__ | ( | self, | |
options, | |||
kw | |||
) |
Initialize options. Args: options: List of allowed values.
def google.appengine.api.validation.Options.Validate | ( | self, | |
value, | |||
key | |||
) |
Validate options. Returns: Original value for provided alias. Raises: ValidationError: when value is not one of predefined values.