def __init__(self, result, status=200, *args, **kwargs):
    if (not isinstance(result, list)):
        if ('errors' in result.keys()):
            dt = (result.pop('errors', {}) or {})
            result['msg'] = ''.join([e[0] for e in dt.values()])
    super(JResponse, self).__init__(json.dumps(result), *args, status=status, mimetype='application/json', **kwargs)
def __init__(self, result, status=200, *args, **kwargs):
    if (not isinstance(result, list)):
        if ('errors' in result.keys()):
            dt = (result.pop('errors', {}) or {})
            result['msg'] = .join([e[0] for e in dt.values()])
    super(JResponse, self).__init__(json.dumps(result), *args, status=status, mimetype='application/json', **kwargs)