Related to the issue above. I have the following form:
form = SQLFORM.factory(table, db.prm_generic, upload=URL('default', 'download'), buttons=buttons)
...
if form.validate():
if request.args(0) == 'landingpages':
if row:
row.update_record(**db.prm_page._filter_fields(form.vars))
sub.update_record(**db.prm_generic._filter_fields(form.vars))
else:
form.vars.pageid = db.prm_page.insert(**db.prm_page._filter_fields(form.vars))
db.prm_generic.insert(**db.prm_generic._filter_fields(form.vars))
When I prepopulate the form, the form does not contain the file link and it does not display
the image. It just contains the browse button.
When I submit the form, without adding an image I get the following error:
Ticket ID
127.0.0.1.2020-11-11.18-02-47.b218631d-6dc1-42b1-af58-3f68e9641716
<class 'RuntimeError'> Unable to handle upload
Version
web2py™
Version 2.20.4-stable+timestamp.2020.05.03.05.18.50
Traceback
The upload field is in sub.update_record(**db.prm_generic._filter_fields(form.vars))
Why doesn't web2py handle this properly?
KInd regards,
Annet
Op woensdag 11 november 2020 om 17:04:00 UTC+1 schreef Annet: