From 37ffa1d34617dded627f8fc6a9c4d3869608fe61 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Mon, 19 Oct 2020 10:41:40 -0500 Subject: [PATCH] Reformat code --- templates/ui/products.html | 46 +++++++++++++++--------------- templates/ui/purchases.html | 54 +++++++++++++++++++----------------- templates/ui/quantities.html | 46 +++++++++++++++--------------- templates/ui/uses.html | 54 +++++++++++++++++++----------------- webapi.py | 2 +- 5 files changed, 105 insertions(+), 97 deletions(-) diff --git a/templates/ui/products.html b/templates/ui/products.html index 5aae140..bca97d2 100644 --- a/templates/ui/products.html +++ b/templates/ui/products.html @@ -1,25 +1,27 @@ - - - - - - - - - - - {% for upc, brand, name, size, sizeunit, description in data %} - - - - - - - - - {% endfor %} -
UPCBrandNameSizeSize UnitDescription
{{ upc }} {{ brand }} {{ name }} {{ size }} {{ sizeunit }} {{ description }}
- + + + + + + + + + + + + {% for upc, brand, name, size, sizeunit, description in data %} + + + + + + + + + {% endfor %} +
UPCBrandNameSizeSize UnitDescription
{{ upc }} {{ brand }} {{ name }} {{ size }} {{ sizeunit }} {{ description }}
+ + \ No newline at end of file diff --git a/templates/ui/purchases.html b/templates/ui/purchases.html index dfffa73..09bb4a5 100644 --- a/templates/ui/purchases.html +++ b/templates/ui/purchases.html @@ -1,29 +1,31 @@ - -
- - -
- -
- - - - - - - - - {% for id, upc, quantity, date, location in data %} - - - - - - - - {% endfor %} -
IDUPCQuantityDateLocation
{{ id }} {{ upc }} {{ quantity }} {{ date }} {{ location }}
- + + +
+ + +
+ +
+ + + + + + + + + {% for id, upc, quantity, date, location in data %} + + + + + + + + {% endfor %} +
IDUPCQuantityDateLocation
{{ id }} {{ upc }} {{ quantity }} {{ date }} {{ location }}
+ + \ No newline at end of file diff --git a/templates/ui/quantities.html b/templates/ui/quantities.html index 3a6ef7e..14192f3 100644 --- a/templates/ui/quantities.html +++ b/templates/ui/quantities.html @@ -1,25 +1,27 @@ - -
- - -
- -
- - - - - - - {% for upc, quantity, location in data %} - - - - - - {% endfor %} -
UPCQuantityLocation
{{ upc }} {{ quantity }} {{ location }}
- + + +
+ + +
+ +
+ + + + + + + {% for upc, quantity, location in data %} + + + + + + {% endfor %} +
UPCQuantityLocation
{{ upc }} {{ quantity }} {{ location }}
+ + \ No newline at end of file diff --git a/templates/ui/uses.html b/templates/ui/uses.html index 8fa1fc0..f858afc 100644 --- a/templates/ui/uses.html +++ b/templates/ui/uses.html @@ -1,29 +1,31 @@ - -
- - -
- -
- - - - - - - - - {% for id, upc, quantity, date, location in data %} - - - - - - - - {% endfor %} -
IDUPCQuantityDateLocation
{{ id }} {{ upc }} {{ quantity }} {{ date }} {{ location }}
- + + +
+ + +
+ +
+ + + + + + + + + {% for id, upc, quantity, date, location in data %} + + + + + + + + {% endfor %} +
IDUPCQuantityDateLocation
{{ id }} {{ upc }} {{ quantity }} {{ date }} {{ location }}
+ + \ No newline at end of file diff --git a/webapi.py b/webapi.py index de6071e..27dacd2 100644 --- a/webapi.py +++ b/webapi.py @@ -316,7 +316,7 @@ def api_create_product(): session.commit() print("committed") return jsonify({'api_endpoints': [f'/api/v1/product/upc/{request.form["upc"]}', - f'/api/v1/product/name/{request.form["name"]}']}) + f'/api/v1/product/name/{request.form["name"]}']}) except IntegrityError: session.rollback() return jsonify({'error': 'INTEGRITY_ERROR'})