![]() |
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 | ToValue |
![]() | |
def | __init__ |
def | __call__ |
def | Validate |
def | ToValue |
Public Attributes | |
expected_type | |
![]() | |
default | |
Additional Inherited Members | |
![]() | |
expected_type = object | |
Validates that a string can compile as a regex without errors. Use this validator when the value of a field should be a regex. That means that the value must be a string that can be compiled by re.compile(). The attribute will then be a compiled re object.
def google.appengine.api.validation.RegexStr.__init__ | ( | self, | |
string_type = unicode , |
|||
default = None |
|||
) |
Initialized regex validator. Raises: AttributeDefinitionError: if string_type is not a kind of string.
def google.appengine.api.validation.RegexStr.ToValue | ( | self, | |
value | |||
) |
Returns the RE pattern for this validator.
def google.appengine.api.validation.RegexStr.Validate | ( | self, | |
value, | |||
key | |||
) |
Validates that the string compiles as a regular expression. Because the regular expression might have been expressed as a multiline string, this function also strips newlines out of value. Args: value: String to compile as a regular expression. key: Name of the field being validated. Raises: ValueError when value does not compile as a regular expression. TypeError when value does not match provided string type.