我有一個mysql查詢列表,我試圖在我的瓶子網站返回。這可能嗎?以下是我的:Python返回列表中的瓶子
def create_new_location():
kitchen_locations = select_location()
return template('''
% for kitchen_location in {{kitchen_locations}}:
<a href="/{{kitchen_location}}/">{{kitchen_location}} Kitchen</a>
<br/>
% end''',kitchen_locations=kitchen_locations)
這是我得到的錯誤。
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/bottle.py", line 862, in _handle
return route.call(**args)
File "/usr/local/lib/python2.7/site-packages/bottle.py", line 1732, in wrapper
rv = callback(*a, **ka)
File "index.py", line 32, in create_new_location
</form>''',kitchen_locations=kitchen_locations)
File "/usr/local/lib/python2.7/site-packages/bottle.py", line 3609, in template
return TEMPLATES[tplid].render(kwargs)
File "/usr/local/lib/python2.7/site-packages/bottle.py", line 3399, in render
self.execute(stdout, env)
File "/usr/local/lib/python2.7/site-packages/bottle.py", line 3386, in execute
eval(self.co, env)
File "<string>", line 6, in <module>
TypeError: unhashable type: 'set'
沒有這是不可能的 –
什麼是你得到的錯誤? –
我基本上想要顯示一個MySQL查詢,並把每個項目的鏈接。 –