added trailingslashes to GET routes

This commit is contained in:
eclipse 2025-08-14 22:46:34 +02:00
parent 05d79eb5e8
commit fb27f39276
4 changed files with 12 additions and 12 deletions

View File

@ -5,8 +5,8 @@ from the_works.models import Text, Reihe, Sprache, Textform, Genre
bp = Blueprint("text", __name__)
@bp.route("/text")
@bp.route("/text/all")
@bp.route("/text/")
@bp.route("/text/all/")
def all():
# select all rows from table "Text", ORM style
rows = db.session.execute(select(Text, Reihe, Textform, Sprache).join(Text.reihe, isouter=True).join(Text.textform, isouter=True).join(Text.sprache, isouter=True))
@ -41,7 +41,7 @@ def read(id):
return render_template("views/text_detail.html", text=text, reihen=db.session.scalars(select(Reihe)), textformen=db.session.scalars(select(Textform)), sprachen=db.session.scalars(select(Sprache)), genres=db.session.scalars(select(Genre)))
@bp.route("/text/create", methods=["POST"])
@bp.route("/text/create/", methods=["POST"])
def create():
text = Text(
Titel = request.form["form_Titel"],

View File

@ -11,8 +11,8 @@ import hashlib
bp = Blueprint("titelbild", __name__)
@bp.route("/titelbild")
@bp.route("/titelbild/all")
@bp.route("/titelbild/")
@bp.route("/titelbild/all/")
def all():
return render_template("views/titelbild.html", titelbilder=map(lambda t: t.asdict_with_urls(), db.session.scalars(select(Titelbild))))
@ -37,7 +37,7 @@ def thumbnail(id):
#raise ValueError(message="requested thumbnail not found")
@bp.route("/titelbild/create", methods=["POST"])
@bp.route("/titelbild/create/", methods=["POST"])
def create():
if request.files["form_Titelbild"].filename == "":
raise TypeError(message="FileStorage object expected")

View File

@ -5,8 +5,8 @@ from the_works.models import Veroeffentlichung, Text, Werk, Werksform, Pseudonym
bp = Blueprint("veroeffentlichung", __name__)
@bp.route("/veroeffentlichung")
@bp.route("/veroeffentlichung/all")
@bp.route("/veroeffentlichung/")
@bp.route("/veroeffentlichung/all/")
def all():
rows = db.session.execute(select(Veroeffentlichung, Text, Werk, Werksform, Pseudonym).join(Veroeffentlichung.text, isouter=True).join(Veroeffentlichung.werk, isouter=True).join(Veroeffentlichung.pseudonym, isouter=True).join(Werk.werksform))
veroeffentlichungen = []
@ -25,7 +25,7 @@ def all():
})
return render_template("views/veroeffentlichung.html", veroeffentlichungen=veroeffentlichungen, texte=db.session.scalars(select(Text)), werke=db.session.scalars(select(Werk)), pseudonyme=db.session.scalars(select(Pseudonym)))
@bp.route("/veroeffentlichung/create", methods=["POST"])
@bp.route("/veroeffentlichung/create/", methods=["POST"])
def create():
db.session.add(Veroeffentlichung(
Text = request.form["form_Text"],

View File

@ -6,8 +6,8 @@ from the_works.models import Werk, Reihe, Verlag, Werksform, Genre, Herausgeber,
bp = Blueprint("werk", __name__)
@bp.route("/werk")
@bp.route("/werk/all")
@bp.route("/werk/")
@bp.route("/werk/all/")
def all():
# select all rows from table "Werk", ORM style
rows = db.session.execute(select(Werk, Reihe, Verlag, Werksform).join(Werk.reihe, isouter=True).join(Werk.verlag, isouter=True).join(Werk.werksform, isouter=True))
@ -57,7 +57,7 @@ def read(id):
return render_template("views/werk_detail.html", werk=werk, reihen=db.session.scalars(select(Reihe)), verlage=db.session.scalars(select(Verlag)), werksformen=db.session.scalars(select(Werksform)), genres=db.session.scalars(select(Genre)), hrsg=db.session.scalars(select(Herausgeber)), titelbilder=titelbilder)
@bp.route("/werk/create", methods=["POST"])
@bp.route("/werk/create/", methods=["POST"])
def create():
werk = Werk(
Titel = request.form["form_Titel"],