From 14365bb113400e576157be9da384c7bf0d80255c Mon Sep 17 00:00:00 2001 From: Arvid Koskinen Date: Sun, 3 Dec 2023 11:34:39 +0200 Subject: Move DB stuff inside a class for further refactoring. --- routes/analyse.py | 3 +-- routes/answer.py | 3 +-- routes/base.py | 3 +-- routes/create.py | 3 +-- routes/question.py | 3 +-- routes/tools.py | 2 +- 6 files changed, 6 insertions(+), 11 deletions(-) (limited to 'routes') diff --git a/routes/analyse.py b/routes/analyse.py index 3b59ae7..8175d47 100644 --- a/routes/analyse.py +++ b/routes/analyse.py @@ -1,7 +1,6 @@ from itertools import combinations -from app import app +from app import app, D from flask import render_template,session,request,redirect -import db_actions as D from routes.tools import rows2dicts, get_alert, get_nick, csrf_check def find_best_and_worst(aid, uid): diff --git a/routes/answer.py b/routes/answer.py index e224b44..89b6aa8 100644 --- a/routes/answer.py +++ b/routes/answer.py @@ -1,6 +1,5 @@ -from app import app +from app import app, D from flask import render_template, session, request, redirect -import db_actions as D from routes.tools import rows2dicts, get_alert, get_nick, csrf_check diff --git a/routes/base.py b/routes/base.py index 2c4b1f2..d5eae8f 100644 --- a/routes/base.py +++ b/routes/base.py @@ -1,7 +1,6 @@ from secrets import token_urlsafe -from app import app +from app import app, D from flask import render_template,session,request,redirect -import db_actions as D from routes.tools import rows2dicts, get_alert, get_nick, csrf_check @app.route("/") diff --git a/routes/create.py b/routes/create.py index 2de8e27..af2e25e 100644 --- a/routes/create.py +++ b/routes/create.py @@ -1,6 +1,5 @@ -from app import app +from app import app, D from flask import render_template,session,request,redirect -import db_actions as D from routes.tools import rows2dicts, get_alert, get_nick, generate_link, csrf_check diff --git a/routes/question.py b/routes/question.py index 42fce8d..41722d5 100644 --- a/routes/question.py +++ b/routes/question.py @@ -1,6 +1,5 @@ -from app import app +from app import app, D from flask import render_template,session,request,redirect -import db_actions as D from routes.tools import rows2dicts, get_alert, get_nick, csrf_check @app.route("/pages/question.html") diff --git a/routes/tools.py b/routes/tools.py index c55ca74..5f6e141 100644 --- a/routes/tools.py +++ b/routes/tools.py @@ -1,6 +1,6 @@ from random import randint from flask import session, request -import db_actions as D +from app import D def rows2dicts( rows, names ): dlist=[] -- cgit v1.2.3