summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2022-05-16 21:08:58 +0200
committerMarius Peter <marius.peter@tutanota.com>2022-05-16 21:08:58 +0200
commit8900d1895eb2067b3ff5aa07763d302b7687fbcf (patch)
treeb6be40ef02a7ee09262d238d099f6c5f3e294d4d /app
parent6d58a93c42ba7003237055da82bd339a66bd3cc8 (diff)
Start work on orders.
Diffstat (limited to 'app')
-rw-r--r--app/__init__.py4
-rw-r--r--app/modules/__init__.py1
-rw-r--r--app/modules/orders/routes.py16
3 files changed, 19 insertions, 2 deletions
diff --git a/app/__init__.py b/app/__init__.py
index 3d1bac6..0e553b3 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -28,7 +28,7 @@ def create_app():
app.register_blueprint(main)
- from .modules import common, auth, products, customers, ferti, invoices
+ from .modules import common, auth, products, customers, ferti, invoices, orders
app.register_blueprint(common)
app.register_blueprint(auth)
@@ -36,5 +36,7 @@ def create_app():
app.register_blueprint(customers)
app.register_blueprint(ferti)
app.register_blueprint(invoices)
+ app.register_blueprint(orders)
+
return app
diff --git a/app/modules/__init__.py b/app/modules/__init__.py
index 56f1d5a..467e59a 100644
--- a/app/modules/__init__.py
+++ b/app/modules/__init__.py
@@ -6,3 +6,4 @@ from .products.routes import products
from .customers.routes import customers
from .ferti.routes import ferti
from .invoices.routes import invoices
+from .orders.routes import 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,
+ )
Copyright 2019--2024 Marius PETER