def extjson request json loads request raw_post_data exec result seria

1
2
3
4
5
def extjson(request):
r = json.loads(request.raw_post_data)
exec('result = serialize(' + r['action'] + '.objects.' + r['method'] + '())')
response = {'result': result, 'action': r['action'], 'method': r['method'], 'type': 'rpc', 'tid': r['tid']}
return HttpResponse(json.dumps(response), content_type='application/javascript')