Hi everyone
I'm using the datetime field in a table of a py4web project, but when I
specify a default value with
db.table.field.default = <datetime value>
The value doesn't show properly in the browser, instead, the field value remains
not defined (as if waiting for input).
I'm not sure this is about my app code or this is the actual behavior.
The controller
# Restrict fields for different roles
db.task.status.default = task.status or "pending"
db.log.title.comment = "Name the task report"
db.log.body.comment = "Write some comment on the progress"
db.task.end.default = now
db.task.end.comment="Only applies for done status; defaults to current time"
# Autopopulate form with task status and other stuff
form = Form([db.task.status,
db.task.end,
db.log.title,
db.log.body,
db.log.tags])
Form is composed of fields from tables in the model
Checking the source code in the browser it shows
<input class="" id="task_end" name="end" type="datetime-local" value="2026-02-12 07:51:53.598215"/>
The default value is placed in the html render but it seems that the js widget does not like it
Regards
Alan