Merge pull request #2030 from leonelcamara/patch-21

Show readable fields with a default in create form
This commit is contained in:
mdipierro
2018-10-06 11:30:14 -07:00
committed by GitHub
+1 -1
View File
@@ -1351,7 +1351,7 @@ class SQLFORM(FORM):
if not readonly:
if not record:
# create form should only show writable fields
fields = [f.name for f in table if (ignore_rw or f.writable) and not f.compute]
fields = [f.name for f in table if (ignore_rw or f.writable or (f.readable and f.default)) and not f.compute]
else:
# update form should also show readable fields and computed fields (but in reaodnly mode)
fields = [f.name for f in table if (ignore_rw or f.writable or f.readable)]