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/*
|
flaskapp/app.py
|
||||||
static/*
|
flaskapp/db.py
|
||||||
templates/*
|
db/schema.sql
|
||||||
Makefile
|
.env
|
||||||
requirements.txt
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class RouteAdmin(routes.Routes):
|
||||||
|
|
||||||
cur = db.get_cursor()
|
cur = db.get_cursor()
|
||||||
cur.execute(
|
cur.execute(
|
||||||
'insert into ${REPO_NAME_SNAKE} '
|
f'insert into {db.TABLE} '
|
||||||
'(email,name,age) values (%s,%s,%s)',
|
'(email,name,age) values (%s,%s,%s)',
|
||||||
(
|
(
|
||||||
form.email.data,
|
form.email.data,
|
||||||
|
|
|
@ -9,6 +9,7 @@ from pymysql.cursors import Cursor
|
||||||
|
|
||||||
from . import exts
|
from . import exts
|
||||||
|
|
||||||
|
TABLE = '${REPO_NAME_SNAKE}'
|
||||||
db_obj: List[Optional[Connection]] = [None]
|
db_obj: List[Optional[Connection]] = [None]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class RoutePages(routes.Routes):
|
||||||
def table():
|
def table():
|
||||||
|
|
||||||
cur = db.get_cursor()
|
cur = db.get_cursor()
|
||||||
cur.execute('SELECT * FROM ${REPO_NAME_SNAKE}')
|
cur.execute(f'SELECT * FROM {db.TABLE}')
|
||||||
rows = cur.fetchall()
|
rows = cur.fetchall()
|
||||||
cur.close()
|
cur.close()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue