Package s3 :: Module s3validators :: Class IS_PHONE_NUMBER
[frames] | no frames]

Class IS_PHONE_NUMBER

source code

gluon.validators.Validator --+
                             |
                            IS_PHONE_NUMBER

Validator for single phone numbers with option to enforce E.123 international notation (with leading + and no punctuation or spaces).

Instance Methods
 
__init__(self, international=False, error_message=None)
Constructor
source code
 
__call__(self, value)
Validation of a value
source code
Method Details

__init__(self, international=False, error_message=None)
(Constructor)

source code 

Constructor

Parameters:
  • international - enforce E.123 international notation, no effect if turned off globally in deployment settings
  • error_message - alternative error message

__call__(self, value)
(Call operator)

source code 

Validation of a value

Parameters:
  • value - the value
Returns:
tuple (value, error), where error is None if value is valid. With international=True, the value returned is converted into E.123 international notation.