From 4937f49bd8c04f9bec2c2cec5d50b0619ed5b69f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 22 May 2007 16:47:55 +0000 Subject: - 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 --- lib/sqlalchemy/sql_util.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql_util.py') 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) -- cgit v1.2.1