sooooo, I got this code to work under the controller function:
db.lecture.course_id.writable = True
#frm = Form(db.lecture, record=lidi, deletable=False, hidden={'course_id':sR.id}, _id="edit")
frm = Form(db.lecture, record=lidi, deletable=False, _id="edit")
frm.vars['course_id'] = sR.id
flash.set(frm.__dict__)
#frm[0]['_style'] = 'display: none;'
if frm.accepted:
#frm.vars['course_id'] = sR.id
flash.set(frm.vars)
redirect(URL(f'lectures/{ridi}', vars={'lidi':frm.vars.get('id')}))
elif frm.errors:
flash.set(f'errors: {frm.errors}')
where ride and lidi are integers passed to the controller function and sR is a single row referring to the courses table.
this is quite messy. I have to set """db.lecture.course_id.writable = True""" or else it won't write to the db. but that makes course_id visible under the form and allows the user to change it. bad because that should be a protected or hidden field. you'll also see that I tried to hide that input and associated divs with commented variations on the """frm[0]['_style'] = 'display: none;'""" line but I could not access the elements or children or find of the form itself. I guess accessing the form elements is out also.
so, darn it, it still makes sense that the hidden parameter of Form should update the db field instead of all of these darned messy work arounds. OR, am I just crazy? frustrated for a graceful solution,,, lucas