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