fixed display of computed fields

This commit is contained in:
mdipierro
2017-12-02 12:52:15 -06:00
parent c9fd0fd71e
commit 4a2a02d1fe
3 changed files with 9 additions and 4 deletions
+4 -3
View File
@@ -1345,9 +1345,10 @@ class SQLFORM(FORM):
# if no fields are provided, build it from the provided table
# will only use writable or readable fields, unless forced to ignore
if fields is None:
fields = [f.name for f in table if
(ignore_rw or f.writable or f.readable) and
not (f.compute and not record)]
if not readonly:
fields = [f.name for f in table if (ignore_rw or f.writable) and (not f.compute or record)]
else:
fields = [f.name for f in table if (ignore_rw or f.readable)]
self.fields = fields
# make sure we have an id