From 8900d1895eb2067b3ff5aa07763d302b7687fbcf Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Mon, 16 May 2022 21:08:58 +0200 Subject: Start work on orders. --- app/modules/orders/routes.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'app/modules/orders') diff --git a/app/modules/orders/routes.py b/app/modules/orders/routes.py index 4027a44..0d2e66a 100644 --- a/app/modules/orders/routes.py +++ b/app/modules/orders/routes.py @@ -21,10 +21,24 @@ import inspect from ... import db -from ...models import * +from ...models import Module, Order from .forms import * orders = Blueprint("orders", __name__) +@orders.route("/modules/orders") +@login_required +def view(): + modules = Module.query.all() + page = request.args.get('page', 1, type=int) + orders = Order.query.order_by(Order.primary_key.desc()).paginate(page=page, per_page=5) + module = "orders" + 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, + invoices=invoices, + ) -- cgit v1.2.3