Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2384 Zobrazení

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

​...


Avatar
Zrušit
Autor Nejlepší odpověď

The code that has worked for me is the following:

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


Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 24
2019
0
dub 15
2903
1
bře 15
6044
1
čvc 24
1079
2
kvě 24
2154