콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2532 화면

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
2222
0
4월 15
2961
1
3월 15
6152
1
7월 24
1225
2
5월 24
2348