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

View File

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

View File

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

View File

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

View File

@ -316,7 +316,7 @@ def api_create_product():
session.commit() session.commit()
print("committed") print("committed")
return jsonify({'api_endpoints': [f'/api/v1/product/upc/{request.form["upc"]}', 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: except IntegrityError:
session.rollback() session.rollback()
return jsonify({'error': 'INTEGRITY_ERROR'}) return jsonify({'error': 'INTEGRITY_ERROR'})