diff --git a/sqlalchemy_utils/types/arrow.py b/sqlalchemy_utils/types/arrow.py index 441368d..d5a3bd0 100644 --- a/sqlalchemy_utils/types/arrow.py +++ b/sqlalchemy_utils/types/arrow.py @@ -85,3 +85,7 @@ class ArrowType(types.TypeDecorator, ScalarCoercible): elif isinstance(value, datetime): value = arrow.get(value) return value + + @property + def python_type(self): + return self.impl.type.python_type diff --git a/sqlalchemy_utils/types/email.py b/sqlalchemy_utils/types/email.py index 59c5b9b..377d92c 100644 --- a/sqlalchemy_utils/types/email.py +++ b/sqlalchemy_utils/types/email.py @@ -11,3 +11,7 @@ class EmailType(sa.types.TypeDecorator): if value is not None: return value.lower() return value + + @property + def python_type(self): + return self.impl.type.python_type diff --git a/sqlalchemy_utils/types/ip_address.py b/sqlalchemy_utils/types/ip_address.py index ec1c27a..7ec9741 100644 --- a/sqlalchemy_utils/types/ip_address.py +++ b/sqlalchemy_utils/types/ip_address.py @@ -67,3 +67,7 @@ class IPAddressType(types.TypeDecorator, ScalarCoercible): def _coerce(self, value): return ip_address(value) if value else None + + @property + def python_type(self): + return self.impl.type.python_type diff --git a/sqlalchemy_utils/types/password.py b/sqlalchemy_utils/types/password.py index 852b3cb..2b45bf4 100644 --- a/sqlalchemy_utils/types/password.py +++ b/sqlalchemy_utils/types/password.py @@ -208,5 +208,9 @@ class PasswordType(types.TypeDecorator, ScalarCoercible): return value + @property + def python_type(self): + return self.impl.type.python_type + Password.associate_with(PasswordType) diff --git a/sqlalchemy_utils/types/url.py b/sqlalchemy_utils/types/url.py index f74475a..7dd4f84 100644 --- a/sqlalchemy_utils/types/url.py +++ b/sqlalchemy_utils/types/url.py @@ -61,3 +61,7 @@ class URLType(types.TypeDecorator, ScalarCoercible): if value is not None and not isinstance(value, furl): return furl(value) return value + + @property + def python_type(self): + return self.impl.type.python_type