diff options
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/type_api.py | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index a73c61147..367b2e203 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -1092,7 +1092,7 @@ class SchemaType(SchemaEventTarget): util.portable_instancemethod(self._on_metadata_drop), ) - def _set_parent(self, column): + def _set_parent(self, column, **kw): column._on_table_attach(util.portable_instancemethod(self._set_table)) def _variant_mapping_for_set_table(self, column): @@ -2857,11 +2857,11 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): def compare_values(self, x, y): return x == y - def _set_parent(self, column): + def _set_parent(self, column, **kw): """Support SchemaEventTarget""" if isinstance(self.item_type, SchemaEventTarget): - self.item_type._set_parent(column) + self.item_type._set_parent(column, **kw) def _set_parent_with_dispatch(self, parent): """Support SchemaEventTarget""" diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py index 9752750c5..bfce00cb5 100644 --- a/lib/sqlalchemy/sql/type_api.py +++ b/lib/sqlalchemy/sql/type_api.py @@ -1063,18 +1063,20 @@ class TypeDecorator(SchemaEventTarget, TypeEngine): """ return self.impl._type_affinity - def _set_parent(self, column): + def _set_parent(self, column, outer=False, **kw): """Support SchemaEventTarget""" super(TypeDecorator, self)._set_parent(column) - if isinstance(self.impl, SchemaEventTarget): - self.impl._set_parent(column) + if not outer and isinstance(self.impl, SchemaEventTarget): + self.impl._set_parent(column, outer=False, **kw) def _set_parent_with_dispatch(self, parent): """Support SchemaEventTarget""" - super(TypeDecorator, self)._set_parent_with_dispatch(parent) + super(TypeDecorator, self)._set_parent_with_dispatch( + parent, outer=True + ) if isinstance(self.impl, SchemaEventTarget): self.impl._set_parent_with_dispatch(parent) @@ -1495,14 +1497,14 @@ class Variant(TypeDecorator): else: return self.impl - def _set_parent(self, column): + def _set_parent(self, column, **kw): """Support SchemaEventTarget""" if isinstance(self.impl, SchemaEventTarget): - self.impl._set_parent(column) + self.impl._set_parent(column, **kw) for impl in self.mapping.values(): if isinstance(impl, SchemaEventTarget): - impl._set_parent(column) + impl._set_parent(column, **kw) def _set_parent_with_dispatch(self, parent): """Support SchemaEventTarget""" |
