From e084f90c19e779592f6e3f14eb8f70a7287f0dad Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 15 May 2022 13:17:35 +0200 Subject: Modularization. --- app/modules/products/routes.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/modules/products/routes.py (limited to 'app/modules/products/routes.py') diff --git a/app/modules/products/routes.py b/app/modules/products/routes.py new file mode 100644 index 0000000..735fef9 --- /dev/null +++ b/app/modules/products/routes.py @@ -0,0 +1,26 @@ +# -*- mode: python; -*- + + +from flask import Blueprint, render_template, request, redirect, flash +from flask_login import login_required + +from ... import db +from ...models import Module, Product +from .forms import * + +products = Blueprint("products", __name__) + + +@products.route("/modules/products") +@login_required +def list(): + modules = Module.query.all() + prods = Product.query.order_by(Product.primary_key.desc()) + module = "products" + flash(f"Successfully accessed module {module}.", "info") + flash(f"Still fighting against styling in {module}.", "error") + return render_template( + f"modules/{module}.html", + modules=modules, + products=prods, + ) -- cgit v1.2.3