-# shortcut for JSON reponses
-class JSONResponse(HttpResponse):
- def __init__(self, data={}, callback=None, **kwargs):
- # get rid of mimetype
- kwargs.pop('mimetype', None)
- data = simplejson.dumps(data)
- if callback:
- data = callback + "(" + data + ");"
- super(JSONResponse, self).__init__(data, mimetype="application/json", **kwargs)
-