-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjson_data.py
29 lines (27 loc) · 924 Bytes
/
json_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
json_data_product=
[ {
"product_id":"edf4a46d-6679-4fb8-bc00-fb352e59d918",
"variant_id":"41",
"quantity":"7"
},
{
"product_id":"edf4a46d-6679-4fb8-bc00-fb352e59d918",
"variant_id":"72",
"quantity":"7"
}
]
json_data_variant= [ {
"product_id":"edf4a46d-6679-4fb8-bc00-fb352e59d918",
"variant_id":"11",
"quantity":"7"
},
{
"product_id":"edf4a46d-6679-4fb8-bc00-fb352e59d918",
"variant_id":"12",
"quantity":"7"
}
]
json_data = json_data_product + json_data_variant # add two list
#json_data = sorted(json_data,key=itemgetter('variant_id'),reverse=True)
json_data = sorted(json_data, key=lambda k: k['variant_id'])
print(json_data)