diff options
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index e57a14681..fd3118e30 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -1692,7 +1692,7 @@ class Enum(Emulated, String, SchemaType): variant_mapping = self._variant_mapping_for_set_table(column) e = schema.CheckConstraint( - type_coerce(column, self).in_(self.enums), + type_coerce(column, String()).in_(self.enums), name=_NONE_NAME if self.name is None else self.name, _create_rule=util.portable_instancemethod( self._should_create_constraint, @@ -1714,13 +1714,14 @@ class Enum(Emulated, String, SchemaType): return process def bind_processor(self, dialect): + parent_processor = super(Enum, self).bind_processor(dialect) + def process(value): value = self._db_value_for_elem(value) if parent_processor: value = parent_processor(value) return value - parent_processor = super(Enum, self).bind_processor(dialect) return process def result_processor(self, dialect, coltype): |
