Finally I've understood how Gitea templates works
This commit is contained in:
parent
51e04f9f0f
commit
103f628bb2
4 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,4 @@
|
|||
flaskapp/*
|
||||
static/*
|
||||
templates/*
|
||||
Makefile
|
||||
requirements.txt
|
||||
flaskapp/app.py
|
||||
flaskapp/db.py
|
||||
db/schema.sql
|
||||
.env
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -9,6 +9,7 @@ from pymysql.cursors import Cursor
|
|||
|
||||
from . import exts
|
||||
|
||||
TABLE = '${REPO_NAME_SNAKE}'
|
||||
db_obj: List[Optional[Connection]] = [None]
|
||||
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue