我有一个由post信息组成的list of tuples(list包含tuples) 但我面临的问题是如何传递到瓶子里的模板,我试了很多次,在stackoverflow中检查了大部分问题,但没有找到一个好的、清晰的问题。在
以下是我尝试过的:
@route('/v/:name')
def page_viwer(name):
id=db.searchU('user', name)
result=db.searchU_forG(id[0][0])
if len(result)>0:#if we got posts
return template('v',post=result)
这是v.tpl
当我尝试这个时,我得到了错误500。。。当我检查日志时,原因是:
%for id, title, dec, pic in post:
TypeError: 'int' object is not iterable
我到处找了找,发现这个作品很好很好。。在
相关问题 更多 >
编程相关推荐