django remove unicode from query result
Django query gives me below output format,but i want below format data=`[{'total': 1744, 'name: u'x'}, {'total': 13, 'name': u'm'}, {'total': 126, 'role': name'n'}]` m=[] for i in data: m.append(i.values()) print m it give me output [[1744,u'x'], [13,u'm'], [126,u'n']] but i need output in how to remove unicode symbol from output [['x',1744], ['m',13], ['n',126]] how to do this ? Thanks in advance Try this: >>> import json >>> data=[{'total': 1744, 'name': u'x'}, {'total': 13, 'name': u'm'}, {'total': 126, 'name': u'n'}] >>> json.dumps([i.values()[::-1] for i in data]) '[["x", 1744], ["m", 13]