添加指向 SQLFORM.grid 的链接,Web2PY
Adding links to SQLFORM.grid, Web2PY
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()
我正在尝试将另一个 link 添加到 SQL 网格,就像上面那个一样。我一直收到语法错误,因为我不知道如何写出来。
'Review',_href=URL("default","review",args=[row.id]
这就是我要添加的link。
您在 link
的括号结束之前关闭了全局数组
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()
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()
我正在尝试将另一个 link 添加到 SQL 网格,就像上面那个一样。我一直收到语法错误,因为我不知道如何写出来。
'Review',_href=URL("default","review",args=[row.id]
这就是我要添加的link。
您在 link
的括号结束之前关闭了全局数组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()