renamed "pages" to "views"; added db support
This commit is contained in:
parent
b7fff0d9fc
commit
764be702c7
@ -1,11 +0,0 @@
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
bp = Blueprint("pages", __name__)
|
||||
|
||||
@bp.route("/")
|
||||
def home():
|
||||
return render_template("pages/home.html")
|
||||
|
||||
@bp.route("/about")
|
||||
def about():
|
||||
return render_template("pages/about.html")
|
||||
25
the_works/views.py
Normal file
25
the_works/views.py
Normal file
@ -0,0 +1,25 @@
|
||||
from flask import Blueprint, render_template
|
||||
from the_works.database import get_db
|
||||
|
||||
bp = Blueprint("views", __name__)
|
||||
|
||||
@bp.route("/")
|
||||
def home():
|
||||
return render_template("views/home.html")
|
||||
|
||||
@bp.route("/texte")
|
||||
def texte():
|
||||
db = get_db()
|
||||
rows = db.execute(
|
||||
"""SELECT
|
||||
t.Titel AS Titel,
|
||||
t.Untertitel AS Untertitel,
|
||||
r.Reihentitel AS Reihe,
|
||||
f.Textform AS Textform,
|
||||
s.Sprache AS Originalsprache
|
||||
FROM Texte t
|
||||
LEFT JOIN Reihen r ON t.Reihe = r.ID
|
||||
LEFT JOIN Textformen f ON t.Textform = f.ID
|
||||
LEFT JOIN Sprachen s ON t.Originalsprache = s.ID;"""
|
||||
).fetchall()
|
||||
return render_template("views/texte.html", rows=rows)
|
||||
Loading…
Reference in New Issue
Block a user