我只想在python列表中显示一个无序列表。我的python应用程序中有以下内容:
var = ['States', ['Kansas', ['Lawrence', 'Topeka'], 'Illinois']]
在我的模板中,我放置了这段代码:
{{ var|unordered_list }}
结果是一条错误消息:
return _helper(value, 1)
File "C:\Program Files (x86)\Google\google_appengine\lib\django_0_96\django\template\defaultfilters.py", line 384, in _helper
'\n'.join([_helper(v, tabs+1) for v in value[1]]), indent, indent)
File "C:\Program Files (x86)\Google\google_appengine\lib\django_0_96\django\template\defaultfilters.py", line 384, in _helper
'\n'.join([_helper(v, tabs+1) for v in value[1]]), indent, indent)
File "C:\Program Files (x86)\Google\google_appengine\lib\django_0_96\django\template\defaultfilters.py", line 382, in _helper
if value[1]:
IndexError: string index out of range
我做错了什么?在Google App Engine中,unordered_list过滤器是否已被破坏?
我正在使用Google App Engine 1.6.0,Python 2.5和webapp框架(django 0.96)。