|
|
|
@ -70,12 +70,12 @@ def delete(id):
|
|
|
|
@app.get("/<int:id>")
|
|
|
|
@app.get("/<int:id>")
|
|
|
|
def show(id):
|
|
|
|
def show(id):
|
|
|
|
cursor.execute('SELECT * FROM items WHERE id=%s', [id])
|
|
|
|
cursor.execute('SELECT * FROM items WHERE id=%s', [id])
|
|
|
|
parent=cursor.fetchone()
|
|
|
|
item=cursor.fetchone()
|
|
|
|
cursor.execute('SELECT * FROM items WHERE parent_id=%s',[id])
|
|
|
|
cursor.execute('SELECT * FROM items WHERE parent_id=%s',[id])
|
|
|
|
if request.cookies.get('movingItemId'):
|
|
|
|
if request.cookies.get('movingItemId'):
|
|
|
|
return render_template('show.html', parent=parent, children=cursor, moving_item_id=request.cookies.get('movingItemId'))
|
|
|
|
return render_template('show.html', item=item, children=cursor, moving_item_id=request.cookies.get('movingItemId'))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return render_template('show.html', parent=parent, children=cursor)
|
|
|
|
return render_template('show.html', item=item, children=cursor)
|
|
|
|
|
|
|
|
|
|
|
|
@app.get('/<int:id>/edit')
|
|
|
|
@app.get('/<int:id>/edit')
|
|
|
|
def edit(id):
|
|
|
|
def edit(id):
|
|
|
|
|