Finally I've understood how Gitea templates works

This commit is contained in:
DarkCat09 2023-02-16 18:25:40 +04:00
parent 51e04f9f0f
commit 103f628bb2
4 changed files with 7 additions and 7 deletions

View file

@ -1,5 +1,4 @@
flaskapp/*
static/*
templates/*
Makefile
requirements.txt
flaskapp/app.py
flaskapp/db.py
db/schema.sql
.env

View file

@ -30,7 +30,7 @@ class RouteAdmin(routes.Routes):
cur = db.get_cursor()
cur.execute(
'insert into ${REPO_NAME_SNAKE} '
f'insert into {db.TABLE} '
'(email,name,age) values (%s,%s,%s)',
(
form.email.data,

View file

@ -9,6 +9,7 @@ from pymysql.cursors import Cursor
from . import exts
TABLE = '${REPO_NAME_SNAKE}'
db_obj: List[Optional[Connection]] = [None]

View file

@ -19,7 +19,7 @@ class RoutePages(routes.Routes):
def table():
cur = db.get_cursor()
cur.execute('SELECT * FROM ${REPO_NAME_SNAKE}')
cur.execute(f'SELECT * FROM {db.TABLE}')
rows = cur.fetchall()
cur.close()