Issue with form and boolean field with default=True

39 views
Skip to first unread message

donal...@gmail.com

unread,
Mar 16, 2021, 6:26:30 PM3/16/21
to py4web
It appears if I have a table with a boolean field for minimal example:

#Model
db.define_table('simple',
Field('test', 'boolean', default=True, label='Test Boolean'))

#Controller
@action("simple/<pid>", method=['GET', 'POST'])
@action("simple", method=['GET', 'POST'])
@action.uses(session, db, auth.user, 'simple.html')
def simple(pid=0):
form = Form(db.simple,
record=pid)
return dict(form=form)

Then the field is always created with the default value and it is not possible to change it to false (other than via the dashboard app).  Workaround is to remove default=True but would be good if this could be verified as a bug and then fixed.

Regards
Donald

Kevin Keller

unread,
Mar 17, 2021, 2:37:16 AM3/17/21
to donal...@gmail.com, py4web
Will see if I can reproduce and then open a ticket.

Should ebe easy to fix.



--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/feca4cd4-ae9f-488f-8c11-9fa859d1450fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages