Fix a problem with Expressions in SQLTABLE possibly fixes #1735 and fixes web2py/pydal#487

This commit is contained in:
Leonel Câmara
2017-11-08 22:21:51 +00:00
parent 2f5eb409b6
commit 4bfa9c1686
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -3328,7 +3328,7 @@ class SQLTABLE(TABLE):
return
REGEX_TABLE_DOT_FIELD = sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD
fieldmap = dict(zip(sqlrows.colnames, sqlrows.fields))
tablemap = dict(((f.tablename, f.table) for f in fieldmap.values()))
tablemap = dict(((f.tablename, f.table) if isinstance(f, Field) else (f._table._tablename, f._table) for f in fieldmap.values()))
for table in tablemap.values():
pref = table._tablename + '.'
fieldmap.update(((pref+f.name, f) for f in table._virtual_fields))