Add support for 'python_type' to 'ColorType'
This commit is contained in:
@@ -49,6 +49,7 @@ class ColorType(types.TypeDecorator, ScalarCoercible):
|
||||
"""
|
||||
STORE_FORMAT = u'hex'
|
||||
impl = types.Unicode(20)
|
||||
python_type = colour.Color
|
||||
|
||||
def __init__(self, max_length=20, *args, **kwargs):
|
||||
# Fail if colour is not found.
|
||||
|
@@ -23,7 +23,7 @@ class EncryptionDecryptionBaseEngine(object):
|
||||
This class must be sub-classed in order to create
|
||||
new engines.
|
||||
"""
|
||||
|
||||
|
||||
def _update_key(self, key):
|
||||
if isinstance(key, six.string_types):
|
||||
key = six.b(key)
|
||||
@@ -208,7 +208,7 @@ class EncryptedType(TypeDecorator):
|
||||
self._key = value
|
||||
|
||||
def _update_key(self):
|
||||
key = self._key() if callable(self._key) else self._key
|
||||
key = self._key() if callable(self._key) else self._key
|
||||
self.engine._update_key(key)
|
||||
|
||||
def process_bind_param(self, value, dialect):
|
||||
|
Reference in New Issue
Block a user