![]() |
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 | |
minimum | |
maximum | |
expected_type | |
![]() | |
default | |
Additional Inherited Members | |
![]() | |
expected_type = object | |
Validates that numbers fall within the correct range. In theory this class can be emulated using Options, however error messages generated from that class will not be very intelligible. This class essentially does the same thing, but knows the intended integer range. Also, this range class supports floats and other types that implement ordinality. The range is inclusive, meaning 3 is considered in the range in Range(1,3).
def google.appengine.api.validation.Range.__init__ | ( | self, | |
minimum, | |||
maximum, | |||
range_type = int , |
|||
default = None |
|||
) |
Initializer for range. At least one of minimum and maximum must be supplied. Args: minimum: Minimum for attribute. maximum: Maximum for attribute. range_type: Type of field. Defaults to int. Raises: AttributeDefinitionError: if the specified parameters are incorrect.
def google.appengine.api.validation.Range.Validate | ( | self, | |
value, | |||
key | |||
) |
Validate that value is within range. Validates against range-type then checks the range. Args: value: Value to validate. key: Name of the field being validated. Raises: ValidationError: when value is out of range. ValidationError when value is not of the same range type.