元组我一直在使用bottlepy和我有这样一件事:如何呈现bottlepy
..code..
comments = [(u'34782439', 78438845, 6, u'hello im nick'),
(u'34754554', 7843545, 5, u'hello im john'),
(u'332432434', 785345545, 3, u'hello im phil')]
return comments
在视图我已经做到了这一点:
%for address date user text in comments:
<h3>{{address}}</h3>
<h3>{{date}}</h3>
<h3>{{user}}</h3>
<h3>{{text}}</h3>
%end
当我启动服务器,错误是:
Error 500: Internal Server Error
Sorry, the requested URL http://localhost:8080/hello caused an error:
Unsupported response type: <type 'tuple'>
我怎么能把它渲染到视图中?
(对不起,我的英语)
我有查看和路由装饰器,“..代码..”是他们的缩写..我的错误是“返回评论”和逗号。谢谢你的帮助!我是python新手,但还不清楚。 – Nicky