Add a python_type constructor (used by EncryptedType)

This commit is contained in:
Ryan Leckey
2014-10-22 05:53:12 -07:00
parent 8b1fc9b64a
commit e465616477

View File

@@ -95,6 +95,9 @@ class PhoneNumberType(types.TypeDecorator, ScalarCoercible):
STORE_FORMAT = 'e164'
impl = types.Unicode(20)
def python_type(self, text):
return self._coerce(text)
def __init__(self, country_code='US', max_length=20, *args, **kwargs):
# Bail if phonenumbers is not found.
if phonenumbers is None: