diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-03-11 20:52:02 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-03-11 20:52:02 +0000 |
| commit | 6a3c374b955299f0065356ef1de6cc0920d5382e (patch) | |
| tree | 1ec2c2fddcc2d3c8b8f350fb42f86a84918c6fe1 /lib/sqlalchemy/engine | |
| parent | 320cb9b75f763355ed798c80d245998ce57e21cc (diff) | |
| download | sqlalchemy-6a3c374b955299f0065356ef1de6cc0920d5382e.tar.gz | |
- for hackers, refactored the "visitor" system of ClauseElement and
SchemaItem so that the traversal of items is controlled by the
ClauseVisitor itself, using the method visitor.traverse(item).
accept_visitor() methods can still be called directly but will
not do any traversal of child items. ClauseElement/SchemaItem now
have a configurable get_children() method to return the collection
of child elements for each parent object. This allows the full
traversal of items to be clear and unambiguous (as well as loggable),
with an easy method of limiting a traversal (just pass flags which
are picked up by appropriate get_children() methods). [ticket:501]
- accept_schema_visitor() methods removed, replaced with
get_children(schema_visitor=True)
- various docstring/changelog cleanup/reformatting
Diffstat (limited to 'lib/sqlalchemy/engine')
| -rw-r--r-- | lib/sqlalchemy/engine/base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 0a53da928..f79167abc 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -446,7 +446,7 @@ class Connection(Connectable): raise exceptions.InvalidRequestError("Unexecuteable object type: " + str(type(object))) def execute_default(self, default, **kwargs): - return default.accept_schema_visitor(self.__engine.dialect.defaultrunner(self.__engine, self.proxy, **kwargs)) + return default.accept_visitor(self.__engine.dialect.defaultrunner(self.__engine, self.proxy, **kwargs)) def execute_text(self, statement, *multiparams, **params): if len(multiparams) == 0: @@ -672,7 +672,7 @@ class Engine(sql.Executor, Connectable): else: conn = connection try: - element.accept_schema_visitor(visitorcallable(self, conn.proxy, connection=conn, **kwargs), traverse=False) + element.accept_visitor(visitorcallable(self, conn.proxy, connection=conn, **kwargs)) finally: if connection is None: conn.close() @@ -1164,13 +1164,13 @@ class DefaultRunner(schema.SchemaVisitor): def get_column_default(self, column): if column.default is not None: - return column.default.accept_schema_visitor(self) + return column.default.accept_visitor(self) else: return None def get_column_onupdate(self, column): if column.onupdate is not None: - return column.onupdate.accept_schema_visitor(self) + return column.onupdate.accept_visitor(self) else: return None |
