Merge pull request #1637 from timrichardson/issues/1636

fix to #1636: sqlgrid left= (left outer join) fails because db._adapt…
This commit is contained in:
mdipierro authored and GitHub committed 2017-06-05 11:48:33 -05:00
commit 7769917102
1 file changed
+2 -2
+2 -2
View File
@@ -29,7 +29,7 @@ from gluon.html import URL, FIELDSET, P, DEFAULT_PASSWORD_DISPLAY
from pydal.base import DEFAULT from pydal.base import DEFAULT
from pydal.objects import Table, Row, Expression, Field, Set, Rows from pydal.objects import Table, Row, Expression, Field, Set, Rows
from pydal.adapters.base import CALLABLETYPES from pydal.adapters.base import CALLABLETYPES
from pydal.helpers.methods import smart_query, bar_encode, _repr_ref from pydal.helpers.methods import smart_query, bar_encode, _repr_ref, merge_tablemaps
from pydal.helpers.classes import Reference, SQLCustomType from pydal.helpers.classes import Reference, SQLCustomType
from gluon.storage import Storage from gluon.storage import Storage
from gluon.utils import md5_hash from gluon.utils import md5_hash
@@ -2329,7 +2329,7 @@ class SQLFORM(FORM):
if not isinstance(left, (list, tuple)): if not isinstance(left, (list, tuple)):
left = [left] left = [left]
for join in left: for join in left:
tablenames += db._adapter.tables(join) tablenames = merge_tablemaps(tablenames, db._adapter.tables(join))
tables = [db[tablename] for tablename in tablenames] tables = [db[tablename] for tablename in tablenames]
if fields: if fields:
# add missing tablename to virtual fields # add missing tablename to virtual fields