def json_response(response, has_trans=False, status_code=200):
 if has_trans:
  response = json.dumps(response, cls=AMOJSONEncoder)
 else:
  response = json.dumps(response)
 return http.HttpResponse(response, content_type='application/json', status=status_code)

def json_response ( response , has_trans = False , status_code = 200 ) : if has_trans : response = json . dumps ( response , cls = AMOJSONEncoder ) else : response = json . dumps ( response ) return http . HttpResponse ( response , content_type = 'application/json' , status = status_code )
return a response as json .