Beispiel #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)
Beispiel #2
0
def shopping_delete(shopping_id):
    _api.delete_lease(shopping_id)
    return api_utils.render()
Beispiel #3
0
def shopping_update(shopping_id, data):
    return api_utils.render(_api.update_shopping(shopping_id, data))
Beispiel #4
0
def shopping_get(shopping_id):
    return api_utils.render(_api.get_shopping(shopping_id))
Beispiel #5
0
def shopping_create(data):
    return api_utils.render(_api.create_shopping(data))
Beispiel #6
0
def shopping_list():
    return api_utils.render(_api.get_shopping_list())
Beispiel #7
0
def shopping_delete(shopping_id):
    _api.delete_lease(shopping_id)
    return api_utils.render()
Beispiel #8
0
def shopping_update(shopping_id, data):
    return api_utils.render(_api.update_shopping(shopping_id, data))
Beispiel #9
0
def shopping_get(shopping_id):
    return api_utils.render(_api.get_shopping(shopping_id))
Beispiel #10
0
def shopping_create(data):
    return api_utils.render(_api.create_shopping(data))
Beispiel #11
0
def shopping_list():
    return api_utils.render(_api.get_shopping_list())