Skip to Content
Menu
This question has been flagged
1 Atsakyti
2444 Rodiniai

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,
​},

​...


Portretas
Atmesti
Autorius Best Answer

The code that has worked for me is the following:

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


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
vas. 24
2072
0
bal. 15
2932
1
kov. 15
6088
1
liep. 24
1140
2
geg. 24
2199