fix to #1636: sqlgrid left= (left outer join) fails because db._adapter.tables() now returns dict (previously a table)

This commit is contained in:
Tim Richardson
2017-06-01 16:53:04 +10:00
parent 8a741023d8
commit f30c31a8a2
+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