diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-11-03 22:13:17 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-11-03 22:13:17 +0000 |
commit | 0af3f8f35b5e46f749d328e6fae90f6ff4915e97 (patch) | |
tree | 8773ab5842f1b3ff39a2e05a9e5fc2ea132ec680 /lib/sqlalchemy/sql/compiler.py | |
parent | 784eaa108a543602e4e7ad42828e8720106fd26d (diff) | |
download | sqlalchemy-0af3f8f35b5e46f749d328e6fae90f6ff4915e97.tar.gz |
- rewritten ClauseAdapter merged from the eager_minus_join branch; this is a much simpler
and "correct" version which will copy all elements exactly once, except for those which were
replaced with target elements. It also can match a wider variety of target elements including
joins and selects on identity alone.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index fa4ac5a9f..ef66ffd5a 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -87,10 +87,11 @@ OPERATORS = { operators.isnot : 'IS NOT' } -class DefaultCompiler(engine.Compiled, visitors.ClauseVisitor): +class DefaultCompiler(engine.Compiled): """Default implementation of Compiled. - Compiles ClauseElements into SQL strings. + Compiles ClauseElements into SQL strings. Uses a similar visit + paradigm as visitors.ClauseVisitor but implements its own traversal. """ __traverse_options__ = {'column_collections':False, 'entry':True} @@ -163,7 +164,9 @@ class DefaultCompiler(engine.Compiled, visitors.ClauseVisitor): if stack: self.stack.append(stack) try: - return self.traverse_single(obj, **kwargs) + meth = getattr(self, "visit_%s" % obj.__visit_name__, None) + if meth: + return meth(obj, **kwargs) finally: if stack: self.stack.pop(-1) |