mardi 3 mars 2015

Grouping JSON data from DJango QuerySet


Vote count:

0




I have this result(JSON) from my Django QuerySet:



{
"high": [{
"counthigh": 27,
"brgy_locat": "Barangay 6"
}, {
"counthigh": 3,
"brgy_locat": "Mabini"
}],
"medium": [{
"brgy_locat": "Barangay 6",
"countmedium": 31
}, {
"brgy_locat": "Tolosa",
"countmedium": 9
}],
"low": [{
"brgy_locat": "Barangay 12",
"countlow": 29
}, {
"brgy_locat": "Mabini",
"countlow": 25
}, {
"brgy_locat": "Barangay 9",
"countlow": 35
}]
}


I wanted to group it by brgy_locat and its values:



brgy_locat | countlow | countmedium | counthigh


Mainly because, I am using datatables.



asked 48 secs ago







Grouping JSON data from DJango QuerySet

Aucun commentaire:

Enregistrer un commentaire