Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pydal/adapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
SELECT_ARGS = set(
('orderby', 'groupby', 'limitby', 'required', 'cache', 'left', 'distinct',
'having', 'join', 'for_update', 'processor', 'cacheable',
'orderby_on_limitby'))
'orderby_on_limitby','outer_scoped'))


class AdapterMeta(type):
Expand Down Expand Up @@ -1092,6 +1092,7 @@ def _select(self, query, fields, attributes):
args_get = attributes.get
tablenames = tables(query)
tablenames_for_common_filters = tablenames
outer_scoped = [t._tablename for t in args_get('outer_scoped',[])]
for field in fields:
for tablename in tables(field):
if not tablename in tablenames:
Expand Down Expand Up @@ -1162,6 +1163,8 @@ def geoexpand(field):
else:
excluded = tablenames

tablenames = [t for t in tablenames if t not in outer_scoped]

if use_common_filters(query):
query = self.common_filter(query,tablenames_for_common_filters)
sql_w = ' WHERE ' + self.expand(query) if query else ''
Expand Down