From eacce0130aff7e117eb526415df99fb6d53c6131 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Thu, 12 Dec 2024 21:02:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D1=81=D0=BC=D0=B5=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Waybill/model.py | 4 +-- App/Waybill/templates/waybill.html | 40 +++++++++++++++++++----------- App/cache/wrapper.py | 2 +- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/App/Waybill/model.py b/App/Waybill/model.py index 8697dce..b13b035 100644 --- a/App/Waybill/model.py +++ b/App/Waybill/model.py @@ -74,12 +74,12 @@ def button_click(request): session["total"] = str(int(session["total"]) + price) session.modified = True else: - print("NEW WORKPIECE") + # print("NEW WORKPIECE") pr_id = product["work_id"] price = product["price"] session["waybill"][str(pr_id)] = "1" session["total"] = str(int(session["total"]) + price) - print(session["waybill"]) + # print(session["waybill"]) session.modified = True elif request.form.get("product_display_minus"): diff --git a/App/Waybill/templates/waybill.html b/App/Waybill/templates/waybill.html index 4698e25..43c6eb3 100644 --- a/App/Waybill/templates/waybill.html +++ b/App/Waybill/templates/waybill.html @@ -39,22 +39,34 @@

Накладная

{% if waybill %} - {% for item in waybill %} - {{ card.render_item(item, show_form = False, show_amount = True) }} - {% endfor %} -
-
Итого: {{ session.get('total', '0') }} ₽
+
+
+
+ {% for item in waybill %} +
+ {{ card.render_item(item, show_form = False, show_amount = True) }} +
+ {% endfor %} +
+
+
+
Итого: {{ session.get('total', '0') }} ₽
+ +
- {% else %} - Ваша накладная пуста - +
+
+ Ваша накладная пуста +
+ +
{% endif %}
diff --git a/App/cache/wrapper.py b/App/cache/wrapper.py index e4a0bba..50f65b0 100644 --- a/App/cache/wrapper.py +++ b/App/cache/wrapper.py @@ -17,7 +17,7 @@ def fetch_from_cache(cache_name: str, cache_config: dict): @wraps(f) def wrapper(*args, **kwargs): cached_value = cache_conn.get_value(cache_name) - print("cached_value=", cached_value) + # print("cached_value=", cached_value) if cached_value: return cached_value response = f(*args, **kwargs)