Added abiltity for dumb people to use
This commit is contained in:
parent
d8c0d9aa1d
commit
a450e8aea2
7
shop.py
7
shop.py
@ -48,6 +48,10 @@ def getItem(rowID):
|
||||
query = f"UPDATE shoplist set gotten = 1 where rowid = {rowID}"
|
||||
runQuery(query)
|
||||
|
||||
def unGetItem(rowID):
|
||||
query = f"UPDATE shoplist set gotten = 0 where rowid = {rowID}"
|
||||
runQuery(query)
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config["DEBUG"] = True
|
||||
app.secret_key = b'*$#@U9423jr92jioJKL_)_;dasfj()12'
|
||||
@ -80,6 +84,9 @@ def handle_data():
|
||||
if "got" in request.form:
|
||||
getItem(request.form["got"])
|
||||
|
||||
if "ungot" in request.form:
|
||||
unGetItem(request.form["ungot"])
|
||||
|
||||
if "loginform" in request.form:
|
||||
if request.form["password"] == "theloves2020":
|
||||
session["allowed"] = "allowed"
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<td> {% if x[3] == 0 %}
|
||||
<form><button class="btn btn-secondary" type="submit" formaction="/post" formmethod="POST" name="got" value="{{x[0]}}">No</button></form>
|
||||
{% else %}
|
||||
yes
|
||||
<form><button class="btn btn-secondary" type="submit" formaction="/post" formmethod="POST" name="ungot" value="{{x[0]}}">Yes</button></form>
|
||||
{% endif %}</td>
|
||||
<td><form>
|
||||
<button class="btn btn-secondary" type="submit" formaction="/post" formmethod="POST" name="rem" value="{{x[0]}}">Remove</button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user