completed merge of virtual fields in fields arguemnt for SQLFORM.grid
This commit is contained in:
+5
-3
@@ -1925,11 +1925,13 @@ class SQLFORM(FORM):
|
|||||||
columns = []
|
columns = []
|
||||||
virtual_columns = []
|
virtual_columns = []
|
||||||
for table in tables:
|
for table in tables:
|
||||||
fields += filter(filter1, table)
|
|
||||||
columns += filter(filter2, table)
|
|
||||||
for k,f in table.iteritems():
|
for k,f in table.iteritems():
|
||||||
if not k.startswith('_'):
|
if not k.startswith('_'):
|
||||||
if isinstance(f,Field.Virtual) and f.readable:
|
if isinstance(f,Field):
|
||||||
|
fields.append(f) #what gets selected
|
||||||
|
if f.readable:
|
||||||
|
columns.append(f) #what gets shown
|
||||||
|
elif isinstance(f,Field.Virtual) and f.readable:
|
||||||
f.tablename = table._tablename
|
f.tablename = table._tablename
|
||||||
#show virtual fields after real fields so put at end of list
|
#show virtual fields after real fields so put at end of list
|
||||||
virtual_columns.append(f) #add to fields as well
|
virtual_columns.append(f) #add to fields as well
|
||||||
|
|||||||
Reference in New Issue
Block a user