fixed problem with Virtual Fields and grid

This commit is contained in:
mdipierro
2013-10-11 17:59:30 -05:00
parent d5fda056ff
commit 3635dd8faf
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.7.2-stable+timestamp.2013.10.11.17.06.24
Version 2.7.2-stable+timestamp.2013.10.11.17.58.33
+6 -5
View File
@@ -1917,14 +1917,14 @@ class SQLFORM(FORM):
else:
fields = []
columns = []
filter1 = lambda f:isinstance(f,Field)
filter2 = lambda f:isinstance(f,Field) and f.readable
for table in tables:
fields += filter(filter1, table)
columns += filter(filter2, table)
for k,f in table.iteritems():
if not k.startswith('_'):
if isinstance(f,Field):
fields.append(f) # these are selected
if f.readable:
columns.append(f) # these are displayed
elif isinstance(f,Field.Virtual) and f.readable:
if isinstance(f,Field.Virtual) and f.readable:
f.tablename = table._tablename
columns.append(f)
fields.append(f)
@@ -2368,6 +2368,7 @@ class SQLFORM(FORM):
continue
if field.type == 'blob':
continue
print row
value = row[str(field)]
maxlength = maxtextlengths.get(str(field), maxtextlength)
if field.represent: