summaryrefslogtreecommitdiff
path: root/app/modules/products/routes.py
blob: 369c80167d0f83f7153a38845927ef8ea6eb0f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 view():
    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,
    )
Copyright 2019--2024 Marius PETER