Reformat code

This commit is contained in:
BBaoVanC 2020-10-19 10:41:40 -05:00
parent 3060a9fafb
commit 37ffa1d346
No known key found for this signature in database
GPG Key ID: 6D74C8B0E7D791C2
5 changed files with 105 additions and 97 deletions

View File

@ -1,25 +1,27 @@
<!DOCTYPE HTML>
<html>
<body>
<table border=1>
<tr>
<th>UPC</th>
<td>Brand</td>
<td>Name</td>
<td>Size</td>
<td>Size Unit</td>
<td>Description</td>
</tr>
{% for upc, brand, name, size, sizeunit, description in data %}
<tr>
<th> {{ upc }} </th>
<td> {{ brand }} </td>
<td> {{ name }} </td>
<td> {{ size }} </td>
<td> {{ sizeunit }} </td>
<td> {{ description }} </td>
</tr>
{% endfor %}
</table>
</body>
<body>
<table border=1>
<tr>
<th>UPC</th>
<td>Brand</td>
<td>Name</td>
<td>Size</td>
<td>Size Unit</td>
<td>Description</td>
</tr>
{% for upc, brand, name, size, sizeunit, description in data %}
<tr>
<th> {{ upc }} </th>
<td> {{ brand }} </td>
<td> {{ name }} </td>
<td> {{ size }} </td>
<td> {{ sizeunit }} </td>
<td> {{ description }} </td>
</tr>
{% endfor %}
</table>
</body>
</html>

View File

@ -1,29 +1,31 @@
<!DOCTYPE HTML>
<html>
<body>
<form action="./purchases">
<input type="text" placeholder="Location" name="location" />
<input type="submit" />
<br>
<input type="reset" value="Reset" onclick="parent.location='./purchases'" />
</form>
<table border=1>
<tr>
<th>ID</th>
<td>UPC</td>
<td>Quantity</td>
<td>Date</td>
<td>Location</td>
</tr>
{% for id, upc, quantity, date, location in data %}
<tr>
<th> {{ id }}</th>
<th> {{ upc }} </th>
<td> {{ quantity }} </td>
<td> {{ date }}</td>
<td> {{ location }} </td>
</tr>
{% endfor %}
</table>
</body>
<body>
<form action="./purchases">
<input type="text" placeholder="Location" name="location" />
<input type="submit" />
<br>
<input type="reset" value="Reset" onclick="parent.location='./purchases'" />
</form>
<table border=1>
<tr>
<th>ID</th>
<td>UPC</td>
<td>Quantity</td>
<td>Date</td>
<td>Location</td>
</tr>
{% for id, upc, quantity, date, location in data %}
<tr>
<th> {{ id }}</th>
<th> {{ upc }} </th>
<td> {{ quantity }} </td>
<td> {{ date }}</td>
<td> {{ location }} </td>
</tr>
{% endfor %}
</table>
</body>
</html>

View File

@ -1,25 +1,27 @@
<!DOCTYPE HTML>
<html>
<body>
<form action="./quantities">
<input type="text" placeholder="Location" name="location" />
<input type="submit" />
<br>
<input type="reset" value="Reset" onclick="parent.location='./quantities'" />
</form>
<table border=1>
<tr>
<th>UPC</th>
<td>Quantity</td>
<td>Location</td>
</tr>
{% for upc, quantity, location in data %}
<tr>
<th> {{ upc }} </th>
<td> {{ quantity }} </td>
<td> {{ location }} </td>
</tr>
{% endfor %}
</table>
</body>
<body>
<form action="./quantities">
<input type="text" placeholder="Location" name="location" />
<input type="submit" />
<br>
<input type="reset" value="Reset" onclick="parent.location='./quantities'" />
</form>
<table border=1>
<tr>
<th>UPC</th>
<td>Quantity</td>
<td>Location</td>
</tr>
{% for upc, quantity, location in data %}
<tr>
<th> {{ upc }} </th>
<td> {{ quantity }} </td>
<td> {{ location }} </td>
</tr>
{% endfor %}
</table>
</body>
</html>

View File

@ -1,29 +1,31 @@
<!DOCTYPE HTML>
<html>
<body>
<form action="./uses">
<input type="text" placeholder="Location" name="location" />
<input type="submit" />
<br>
<input type="reset" value="Reset" onclick="parent.location='./uses'" />
</form>
<table border=1>
<tr>
<th>ID</th>
<td>UPC</td>
<td>Quantity</td>
<td>Date</td>
<td>Location</td>
</tr>
{% for id, upc, quantity, date, location in data %}
<tr>
<th> {{ id }}</th>
<th> {{ upc }} </th>
<td> {{ quantity }} </td>
<td> {{ date }}</td>
<td> {{ location }} </td>
</tr>
{% endfor %}
</table>
</body>
<body>
<form action="./uses">
<input type="text" placeholder="Location" name="location" />
<input type="submit" />
<br>
<input type="reset" value="Reset" onclick="parent.location='./uses'" />
</form>
<table border=1>
<tr>
<th>ID</th>
<td>UPC</td>
<td>Quantity</td>
<td>Date</td>
<td>Location</td>
</tr>
{% for id, upc, quantity, date, location in data %}
<tr>
<th> {{ id }}</th>
<th> {{ upc }} </th>
<td> {{ quantity }} </td>
<td> {{ date }}</td>
<td> {{ location }} </td>
</tr>
{% endfor %}
</table>
</body>
</html>

View File

@ -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'})