summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql_util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-05-22 16:47:55 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-05-22 16:47:55 +0000
commit4937f49bd8c04f9bec2c2cec5d50b0619ed5b69f (patch)
tree7d2c8c651846aae3998d04d79fe4082498ccdecc /lib/sqlalchemy/sql_util.py
parent2ee1d4042825cf5cb0eb5a6a7659d8398d73a4c3 (diff)
downloadsqlalchemy-4937f49bd8c04f9bec2c2cec5d50b0619ed5b69f.tar.gz
- improved support for eagerloading of properties off of mappers that are mapped
to select() statements; i.e. eagerloader is better at locating the correct selectable with which to attach its LEFT OUTER JOIN. - some fixes to new tests in inheritance5 to work with postgres
Diffstat (limited to 'lib/sqlalchemy/sql_util.py')
-rw-r--r--lib/sqlalchemy/sql_util.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql_util.py b/lib/sqlalchemy/sql_util.py
index 1f5ac1681..debf1da4f 100644
--- a/lib/sqlalchemy/sql_util.py
+++ b/lib/sqlalchemy/sql_util.py
@@ -65,14 +65,19 @@ class TableCollection(object):
class TableFinder(TableCollection, sql.NoColumnVisitor):
- """Given a ``Clause``, locate all the ``Tables`` within it into a list."""
+ """locate all Tables within a clause."""
- def __init__(self, table, check_columns=False):
+ def __init__(self, table, check_columns=False, include_aliases=False):
TableCollection.__init__(self)
self.check_columns = check_columns
+ self.include_aliases = include_aliases
if table is not None:
self.traverse(table)
+ def visit_alias(self, alias):
+ if self.include_aliases:
+ self.tables.append(alias)
+
def visit_table(self, table):
self.tables.append(table)