diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-16 18:32:25 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-16 18:32:25 +0000 |
| commit | abc33bd32d6fd11f46bdc3e65ce97b606ce1cb89 (patch) | |
| tree | fcd07dee8fe2a2dc4bf84dee1deed28cca6d9c8c /lib/sqlalchemy/sql/visitors.py | |
| parent | 8ce3f5d6997be2d28e88f2ed982454e7b4d6e3fa (diff) | |
| download | sqlalchemy-abc33bd32d6fd11f46bdc3e65ce97b606ce1cb89.tar.gz | |
- more fixes to the LIMIT/OFFSET aliasing applied with Query + eagerloads,
in this case when mapped against a select statement [ticket:904]
- _hide_froms logic in expression totally localized to Join class, including search through previous clone sources
- removed "stop_on" from main visitors, not used
- "stop_on" in AbstractClauseProcessor part of constructor, ClauseAdapter sets it up based on given clause
- fixes to is_derived_from() to take previous clone sources into account, Alias takes self + cloned sources into account. this is ultimately what the #904 bug was.
Diffstat (limited to 'lib/sqlalchemy/sql/visitors.py')
| -rw-r--r-- | lib/sqlalchemy/sql/visitors.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/sqlalchemy/sql/visitors.py b/lib/sqlalchemy/sql/visitors.py index 150ee9cc7..bb63ab09c 100644 --- a/lib/sqlalchemy/sql/visitors.py +++ b/lib/sqlalchemy/sql/visitors.py @@ -37,18 +37,17 @@ class ClauseVisitor(object): meth(obj, **kwargs) v = getattr(v, '_next', None) - def iterate(self, obj, stop_on=None): + def iterate(self, obj): stack = [obj] traversal = [] while len(stack) > 0: t = stack.pop() - if stop_on is None or t not in stop_on: - yield t - traversal.insert(0, t) - for c in t.get_children(**self.__traverse_options__): - stack.append(c) + yield t + traversal.insert(0, t) + for c in t.get_children(**self.__traverse_options__): + stack.append(c) - def traverse(self, obj, stop_on=None, clone=False): + def traverse(self, obj, clone=False): if clone: cloned = {} @@ -60,17 +59,15 @@ class ClauseVisitor(object): return cloned[obj] obj = do_clone(obj) - stack = [obj] traversal = [] while len(stack) > 0: t = stack.pop() - if stop_on is None or t not in stop_on: - traversal.insert(0, t) - if clone: - t._copy_internals(clone=do_clone) - for c in t.get_children(**self.__traverse_options__): - stack.append(c) + traversal.insert(0, t) + if clone: + t._copy_internals(clone=do_clone) + for c in t.get_children(**self.__traverse_options__): + stack.append(c) for target in traversal: v = self while v is not None: |
