我正在尝试在我的本地主机上实现此代码:
def form_a():
form = SQLFORM(db.registration, deletable=True, request.args(0), upload=URL(r=request, f='download'))
if form.accepts(request.vars, session):
if not form.record:
response.flash = "Your input data has been submitted."
else:
if form.vars.delete_this_record:
session.flash = "User record successfully deleted."
else:
session.flash = "User record successfully updated."
redirect(URL(r=request, f='form_a’))
records = db().select(db.registration.ALL)
return dict(form=form, records=records)
但是在这一行的关键字 arg 错误之后,我得到了一个非关键字 arg :
form = SQLFORM(db.registration, deletable=True, request.args(0), upload=URL(r=request, f='download'))
在此行扫描文字错误时出现EOL:
redirect(URL(r=request, f='form_a’))
我正在使用 Python 3 和 Web2Py 2.4.6,谢谢。