通过词典列表我有Python字典看起来像这样的列表:解析作为POST参数
sandwiches = [
{'bread':'wheat', 'topping':'tomatoes', 'meat':'bacon'},
{'bread':'white', 'topping':'peanut butter', 'meat':'bacon'},
{'bread':'sourdough', 'topping':'cheese', 'meat':'bacon'}
]
我想通过这个作为POST参数传递给另一个Django应用程序。客户端应用程序需要做什么来遍历列表?
我想要做的事,如:
for sandwich in request.POST['sandwiches']:
print "%s on %s with %s is yummy!" % (sandwich['meat'], sandwich['bread'], sandwich['topping'])
但我似乎不具有类型的字典列表时,我的数据到达我的客户端应用程序。