Re: [Sqlalchemy-tickets] [sqlalchemy] #2037: move ddlevents dispatch to SchemaItem; add "init" eve
Brought to you by:
zzzeek
#2037: move ddlevents dispatch to SchemaItem; add "init" event, "before_parent_attach", "after_parent_attach" to all SchemaItem classes; replace column._on_table_attach with event -------------------------+-------------------------------------------------- Reporter: zzzeek | Owner: zzzeek Type: enhancement | Status: new Priority: medium | Milestone: 0.7.0 Component: schema | Severity: major - 1-3 hours Keywords: events | Status_field: in queue -------------------------+-------------------------------------------------- Comment(by zzzeek): {{{ #!diff --- a/lib/sqlalchemy/schema.py Sun Jan 30 15:08:41 2011 -0500 +++ b/lib/sqlalchemy/schema.py Sun Jan 30 18:24:35 2011 -0500 @@ -66,6 +66,11 @@ raise NotImplementedError() + def _set_parent_with_dispatch(self, parent): + self.dispatch.before_parent_attach(self.parent) + self._set_parent(parent) + self.dispatch.after_parent_attach(self.parent) + def get_children(self, **kwargs): """used to allow SchemaVisitor access""" return [] }}} -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2037#comment:2> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |