From ec2974eef3e8b72d58792349fd98283c68a41519 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 4 Oct 2020 15:05:10 -0500 Subject: [PATCH] Remove old commented-out code --- webapi.py | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/webapi.py b/webapi.py index 3fd522e..b221558 100644 --- a/webapi.py +++ b/webapi.py @@ -256,7 +256,7 @@ def api_create_brand(): else: locdesc = None - print(locname, locdesc) + print(f"creating brand with name {locname} and description {locdesc}") cur.execute("INSERT INTO brand (name, description) VALUES (%s, %s)", (locname, locdesc)) print("ran INSERT INTO brand (name, description) VALUES (%s, %s)") db.commit() @@ -264,41 +264,5 @@ def api_create_brand(): return jsonify({'api_endpoint': '/api/v1/brand/name/{0}'.format(locname)}) -# @app.route("//api/v1/item///new_brand", methods = ["POST"]) -# def api_new_brand(location, item, brand): - # try: - # storage.init_brand(location, item, brand) - # print("Created brand {0} under item {1} at {2}".format(brand, item, location)) - # return jsonify({'status': 'success'}) - # except storage.AlreadyExistsError: - # return jsonify({'status': 'error', 'error': 'BRAND_ALREADY_EXISTS'}), status.HTTP_403_FORBIDDEN - - -# @app.route("//api/v1/item//new_item", methods = ["POST"]) -# def api_new_item(location, item): - # try: - # storage.init_item(location, item) - # print("Created item {0} at {1}".format(item, location)) - # return jsonify({'status': 'success'}) - # except storage.AlreadyExistsError: - # return jsonify({'status': 'error', 'error': 'ITEM_ALREADY_EXISTS'}), status.HTTP_403_FORBIDDEN - - -# @app.route("//api/v1/new_location", methods = ["POST"]) -# def api_new_location(location): - # try: - # storage.init_location(location) - # print("Created location {0}".format(location)) - # return jsonify({'status': 'success'}) - # except storage.AlreadyExistsError: - # return jsonify({'status': 'error', 'error': 'ITEM_ALREADY_EXISTS'}), status.HTTP_403_FORBIDDEN - - -# @app.route("//api/v1/item///add_amount/", methods = ["POST"]) -# def api_add_amount(location, item, brand, amount): - # storage.increment_amount(location, item, brand, amount) - # return jsonify({'status': 'success'}) - - if __name__ == "__main__": print("Run with `flask` or a WSGI server!")