def index():
gridHome = SQLFORM.grid(db.games, editable=False, create=False, csv=False, deletable=False, details=False,
links = [lambda row: A('View Post',_href=URL("default","show",args=[row.id]))])
return locals()
我正在尝试添加另一个链接到SQL网格,就像上面的那个。我一直收到语法错误,因为我不知道如何写出来。
'Review',_href=URL("default","review",args=[row.id]
这是我要添加的链接。
答案 0 :(得分:2)
在关闭链接括号
之前,您正在关闭全局数组def index():
gridHome = SQLFORM.grid(db.games, editable=False, create=False, csv=False, deletable=False, details=False,
links = [lambda row: A('View Post',_href=URL("default","show",args=[row.id])),
lambda row: A('Review',_href=URL("default","review",args=[row.id]))])
return locals()