Working on delete button
This commit is contained in:
parent
59064a6088
commit
4a3f7dc1e9
15
app.py
15
app.py
@ -13,6 +13,19 @@ app = Flask(__name__)
|
||||
|
||||
@app.route('/favicon.ico')
|
||||
|
||||
@app.route('/delete/<tmp>',methods=['POST', 'GET'])
|
||||
def delete(tmp):
|
||||
|
||||
conn = sqlite3.connect('app.db')
|
||||
cursor = conn.cursor()
|
||||
|
||||
if request.method == 'POST':
|
||||
print("POST")
|
||||
if request.method == "GET":
|
||||
print("GET")
|
||||
print(tmp)
|
||||
return redirect('/')
|
||||
|
||||
@app.route('/create',methods=['GET', 'POST'])
|
||||
def create():
|
||||
conn = sqlite3.connect('app.db')
|
||||
@ -302,7 +315,7 @@ def inventory(tmp,u_id):
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
return render_template('table.html', tmp=tmp,title=set_list[0][1],set_list=set_list,inventory_list=inventory_list,missing_list=missing_list,minifig_list=minifig_list,minifig_inventory_list=minifig_inventory_list)
|
||||
return render_template('table.html', u_id=u_id,tmp=tmp,title=set_list[0][1],set_list=set_list,inventory_list=inventory_list,missing_list=missing_list,minifig_list=minifig_list,minifig_inventory_list=minifig_inventory_list)
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
|
@ -259,6 +259,9 @@ td img{
|
||||
<a class="navbar-item hidden-desktop" id="expand-button">
|
||||
Expand Columns
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ '/delete/' + u_id }}" class="navbar-item">
|
||||
Delete
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="navMenu" class="navbar-menu">
|
||||
@ -267,7 +270,6 @@ td img{
|
||||
</div>
|
||||
|
||||
<div class="navbar-end">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
Loading…
Reference in New Issue
Block a user