تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2378 أدوات العرض

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
فبراير 24
2009
0
أبريل 15
2900
1
مارس 15
6037
1
يوليو 24
1064
2
مايو 24
2151