From 7eb67fe6fa3790fc74ccd67a49398f6f1a34217c Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 4 Oct 2013 00:16:30 -0500 Subject: [PATCH] fields with readable=False should not be exportable from grid --- VERSION | 2 +- gluon/sqlhtml.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 2e3df8b9..deacfac2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.4-stable+timestamp.2013.10.03.08.39.06 +Version 2.6.4-stable+timestamp.2013.10.04.00.15.28 diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 45da4cd1..0195d3b3 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -1921,13 +1921,16 @@ class SQLFORM(FORM): fields = [] columns = [] for table in tables: - fields += [f for f in table] - columns += [f for f in table] for k,f in table.iteritems(): - if isinstance(f,Field.Virtual) and f.readable: + if isinstance(f,Field): + fields.append(f) # these are selected + if f.readable: + columns.append(f) # these are displayed/exported + elif isinstance(f,Field.Virtual) and f.readable: f.tablename = table._tablename columns.append(f) fields.append(f) + if not field_id: if groupby is None: field_id = tables[0]._id