示例#1
0
def make_json_error(ex):
    if isinstance(ex, werkzeug_exceptions.HTTPException):
        status_code = ex.code
        description = ex.description
    else:
        status_code = 500
        description = str(ex)
    return api_utils.render({'error': status_code,
                             'error_message': description},
                            status=status_code)
示例#2
0
def shopping_delete(shopping_id):
    _api.delete_lease(shopping_id)
    return api_utils.render()
示例#3
0
def shopping_update(shopping_id, data):
    return api_utils.render(_api.update_shopping(shopping_id, data))
示例#4
0
def shopping_get(shopping_id):
    return api_utils.render(_api.get_shopping(shopping_id))
示例#5
0
def shopping_create(data):
    return api_utils.render(_api.create_shopping(data))
示例#6
0
def shopping_list():
    return api_utils.render(_api.get_shopping_list())
示例#7
0
def shopping_delete(shopping_id):
    _api.delete_lease(shopping_id)
    return api_utils.render()
示例#8
0
def shopping_update(shopping_id, data):
    return api_utils.render(_api.update_shopping(shopping_id, data))
示例#9
0
def shopping_get(shopping_id):
    return api_utils.render(_api.get_shopping(shopping_id))
示例#10
0
def shopping_create(data):
    return api_utils.render(_api.create_shopping(data))
示例#11
0
def shopping_list():
    return api_utils.render(_api.get_shopping_list())