From e7fd8ee0b77576e7d1ee65336ddace8c4ae1a796 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 23 Sep 2012 19:16:27 -0500 Subject: [PATCH] linked_tables in smartgrid can be a dict() --- VERSION | 2 +- gluon/sqlhtml.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 06a6fed3..dcbbf3cd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.9 (2012-09-23 17:00:31) stable +Version 2.0.9 (2012-09-23 19:16:20) stable diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index a4ab927d..26cc90b8 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -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]