Hello Massimo,
thanks for replying.
Maybe I didn't quite understand.
I assumed that when using the Sqlform.factory no "record" is transmitted.
This means that the "create" branch is always used in 2.21, 2.18, 2.15.4,
independent of "create" or "edit" forms.
In my point of view, for sqlform.factory, there is no difference between create / edit.
For my purposes, the "old" code
fields = [f.name for f in table if (ignore_rw or f.writable or f.readable) and (readonly or not f.compute)] was correct, cause I want to show a readable Field in an edit form, even when its value is ""
but changing to "f.readable and f.default", when f.default = "", will result in a no show.
Am I wrong?
code, 2.21, 2.18,
if fields is None:
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 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)]
else:
# read only form should show all readable fields
fields = [
f.name for f in table if (ignore_rw or f.readable)]