跳至内容
菜单
此问题已终结
1 回复
2376 查看

I have built a dictionary to collect orders according to the client, the products that have been ordered and I need to order it alphabetically by client to use it in a qweb report, nothing I have tried so far has worked for me. Any ideas?

reparto_data = {
​'Cliente 1': {
​'Pastel manzana': 12,
​'Bomba crema': 8,
​},

​'Cliente 2': {
​'Cake calabaza': 18,
​'Bombon chocolate': 8,
​},

​...


形象
丢弃
编写者 最佳答案

The code that has worked for me is the following:

reparto_data2 = sorted(reparto_data.items(), key=lambda x: x[0].lower())


形象
丢弃
相关帖文 回复 查看 活动
1
2月 24
2006
0
4月 15
2900
1
3月 15
6035
1
7月 24
1059
2
5月 24
2146