From 97a247e1bdc3fac81316ac5fc7c966583bdf8fb4 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Mon, 23 Jan 2023 09:24:22 -0500 Subject: [PATCH] cursor -> children --- server.py | 8 ++++---- templates/show.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index dd009c1..065ce47 100644 --- a/server.py +++ b/server.py @@ -28,9 +28,9 @@ app.wsgi_app = HTTPMethodOverrideMiddleware(app.wsgi_app) def show_all(): cursor.execute('SELECT * FROM items WHERE parent_id IS NULL') if request.cookies.get('movingItemId'): - return render_template('show.html', cursor=cursor, moving_item_id=request.cookies.get('movingItemId')) + return render_template('show.html', children=cursor, moving_item_id=request.cookies.get('movingItemId')) else: - return render_template('show.html', cursor=cursor) + return render_template('show.html', children=cursor) @app.post("/") def create(): @@ -73,9 +73,9 @@ def show(id): parent=cursor.fetchone() cursor.execute('SELECT * FROM items WHERE parent_id=%s',[id]) if request.cookies.get('movingItemId'): - return render_template('show.html', parent=parent, cursor=cursor, moving_item_id=request.cookies.get('movingItemId')) + return render_template('show.html', parent=parent, children=cursor, moving_item_id=request.cookies.get('movingItemId')) else: - return render_template('show.html', parent=parent, cursor=cursor) + return render_template('show.html', parent=parent, children=cursor) @app.get('//edit') def edit(id): diff --git a/templates/show.html b/templates/show.html index 7f737a5..205f39d 100644 --- a/templates/show.html +++ b/templates/show.html @@ -23,7 +23,7 @@

Items

{%endif%}