summaryrefslogtreecommitdiff
path: root/app/modules/orders/routes.py
blob: 0d2e66a4781ae7ec5c67edb833e8ba612ed41048 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- mode: python; -*-


from flask import (
    Blueprint,
    render_template,
    send_file,
    request,
    redirect,
    flash,
    url_for,
    jsonify,
    abort,
)
from flask_login import login_required, current_user


# from datetime import datetime
import inspect



from ... import db
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,
    )
Copyright 2019--2024 Marius PETER