I want to modify a record from db.project, and there are a reference field in db.project.
So I use SQLFORM.factory to add field to put reference list name.
the code I paste is simplify version
here is full code
project = db((db.project.id == 1) & (db.frature.project_id == 1)).select(db.project.ALL, db.feature.ALL).first()
form = SQLFORM.factory(Field('list_name', 'string', label='List Name'), db.project, db.feature, table_name='project',upload=URL('download'))
for t in [db.project, db.project_feature]:
__copydata(db(query).select(limitby=(0,1)).first(), form.vars, t.fields)
so, that me ask another question:
How to make SQLFORM.widgets.upload.widget work.
I mean make the link button appear.
what content I need to put in form.var?
Anthony於 2016年2月28日星期日 UTC+8下午9時29分52秒寫道: