From a03aa84c31bee4c13a32612109c79e86a2afcd53 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 14 Nov 2007 16:43:21 +0000 Subject: - DeferredColumnLoader checks row for column, if present sends it to ColumnLoader to create the row processor - eager loaders ensure deferred foreign key cols are present in the primary list of columns (and secondary...). because eager loading with LIMIT/OFFSET doesn't re-join to the parent table anymore this is now necessary. [ticket:864] --- lib/sqlalchemy/sql/util.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 81d28ac7e..70d1940e6 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -96,6 +96,11 @@ class ColumnFinder(visitors.ClauseVisitor): def __iter__(self): return iter(self.columns) +def find_columns(selectable): + cf = ColumnFinder() + cf.traverse(selectable) + return iter(cf) + class ColumnsInClause(visitors.ClauseVisitor): """Given a selectable, visit clauses and determine if any columns from the clause are in the selectable. -- cgit v1.2.1