linked_tables in smartgrid can be a dict()

This commit is contained in:
mdipierro
2012-09-23 19:16:27 -05:00
parent 554fe30288
commit e7fd8ee0b7
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.0.9 (2012-09-23 17:00:31) stable
Version 2.0.9 (2012-09-23 19:16:20) stable
+2 -2
View File
@@ -2251,7 +2251,7 @@ class SQLFORM(FORM):
if nargs>len(args)+1:
query = (field == id)
if isinstance(linked_tables,dict):
linked_tables = linked_tables.get(tablename,[])
linked_tables = linked_tables.get(table._tablename,[])
if linked_tables is None or referee in linked_tables:
field.represent = lambda id,r=None,referee=referee,rep=field.represent: A(callable(rep) and rep(id) or id,_class=trap_class(),_href=url(args=['view',referee,id]))
except (KeyError,ValueError,TypeError):
@@ -2277,7 +2277,7 @@ class SQLFORM(FORM):
check[rfield.tablename] = \
check.get(rfield.tablename,[])+[rfield.name]
if isinstance(linked_tables,dict):
linked_tables = linked_tables.get(tablename,[])
linked_tables = linked_tables.get(table._tablename,[])
for tablename in sorted(check):
linked_fieldnames = check[tablename]
tb = db[tablename]