Skip to content Skip to sidebar Skip to footer

Remove U' Infront Of My Json Data

I'm new to python and it seems that all my JSON data is combined with u' prefix as such: {u'number': u'12345666', u'items'...} I don't need this data (unicode or whatever) as I wa

Solution 1:

The problem is that you are converting a dictionary to a string (probably Mako does str(...) for you). But you should jsonify it, i.e.

import json
context = { 'data': json.dumps(getitems(self)) }

Post a Comment for "Remove U' Infront Of My Json Data"