fixed problem with Virtual Fields and grid
This commit is contained in:
@@ -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
@@ -1917,14 +1917,14 @@ class SQLFORM(FORM):
|
|||||||
else:
|
else:
|
||||||
fields = []
|
fields = []
|
||||||
columns = []
|
columns = []
|
||||||
|
filter1 = lambda f:isinstance(f,Field)
|
||||||
|
filter2 = lambda f:isinstance(f,Field) and f.readable
|
||||||
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):
|
if isinstance(f,Field.Virtual) and f.readable:
|
||||||
fields.append(f) # these are selected
|
|
||||||
if f.readable:
|
|
||||||
columns.append(f) # these are displayed
|
|
||||||
elif isinstance(f,Field.Virtual) and f.readable:
|
|
||||||
f.tablename = table._tablename
|
f.tablename = table._tablename
|
||||||
columns.append(f)
|
columns.append(f)
|
||||||
fields.append(f)
|
fields.append(f)
|
||||||
@@ -2368,6 +2368,7 @@ class SQLFORM(FORM):
|
|||||||
continue
|
continue
|
||||||
if field.type == 'blob':
|
if field.type == 'blob':
|
||||||
continue
|
continue
|
||||||
|
print row
|
||||||
value = row[str(field)]
|
value = row[str(field)]
|
||||||
maxlength = maxtextlengths.get(str(field), maxtextlength)
|
maxlength = maxtextlengths.get(str(field), maxtextlength)
|
||||||
if field.represent:
|
if field.represent:
|
||||||
|
|||||||
Reference in New Issue
Block a user