我有这2个带有2个Web表单的控制器。我无法获取预填充sqlform的参数。 contact_id和ship_to_id是定义中的参考字段。任何帮助将不胜感激。
def Destination():
btn = lambda row: A("New Shipper", _href=URL('New_Shipper', args=[row.Contact.id,row.Contact.destination_id]))
db.Contact.edit = Field.Virtual(btn)
grid = SQLFORM.smartgrid(db.Destination,linked_tables=['Contact'],csv=False,deletable=False,editable=False,details=False)
return dict(grid=grid)
def New_Shipper():
form = SQLFORM(db.Shipper)
form.vars.Contact_id = request.args(0)
form.vars.Ship_To_ID = request.args(1)
return dict(form=form)