fix: Updated Store for Product Categories, Products, and Product Permutations pages for tweaked architecture for controllers, datastores, and python data objects.

This commit is contained in:
2024-10-14 11:42:51 +01:00
parent fdcf448bb1
commit 1e2dff4ad3
18 changed files with 201 additions and 188 deletions

123
app.log
View File

@@ -1,65 +1,58 @@
Request: 127.0.0.1 GET http /store/stock_items?id_category=3&id_product=&is_out_of_stock=false&quantity_min=&quantity_max= Host: 127.0.0.1:5000 Traceback: Traceback (most recent call last):
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0 response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
Accept-Language: en-GB,en;q=0.5 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function
Accept-Encoding: gzip, deflate, br, zstd return cors_after_request(app.make_response(f(*args, **kwargs)))
^^^^^^^^^^^^^^^^^^
Referer: http://127.0.0.1:5000/store/stock_items?id_category=3&id_product=3&is_out_of_stock=false&quantity_min=&quantity_max= File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
Dnt: 1 ^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
Connection: keep-alive return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^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Z_9KC_IvSj1PqZ47lOF7kBJxQf0-6HE1-LnQdBkj7vuk-vnyB0X1ePYKcwgU7irlUQM9qMXSLd_cxQX3BWN8bg_9MqkIg_3ebpy11BSY5H25lXekdYuTjoE-SJcVusbhBoB-mRu0Pht0iaYN70Aftm87n8AtLQzqmcP_BQ5Zi-VhgYooHAcELPBNCjvlb95URiF_ar03yC_z61vUzLf1MbfEPwOqHfXj-qbLDowgumurtcTQ57O4kWpZr2VxQ1iE-5yUdcv5RVq3xHvYqlU8bh_C_6dWGBgY97sYmZ8wogmLmJDEnSZPgP2jqg2EXNC14s2_fvv0TX22jag.ZwjUoA.pitPRgpTPJyCaDMIr0TPpBG_lIc File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 45, in stock_items
return render_template('pages/store/_stock_items.html', model = model, datetime = datetime)
Upgrade-Insecure-Requests: 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template
Sec-Fetch-Dest: document return _render(app, template, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sec-Fetch-Mode: navigate File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render
rv = template.render(context)
Sec-Fetch-Site: same-origin ^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render
Sec-Fetch-User: ?1 self.environment.handle_exception()
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception
Sec-Gpc: 1 raise rewrite_traceback_stack(source=source)
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 1, in top-level template code
Priority: u=0, i {% extends 'layouts/layout.html' %}
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 326, in top-level template code
{% block page_body %}{% endblock %}
^^^^^^^^^^^^^^^^^^^^^^^^^
Request data: b'' File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 127, in block 'page_body'
Traceback: Traceback (most recent call last): var products = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.category_list_filters.get_list_products()) | tojson | safe }};
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app ^^^^^^^^^^^^^^^^^^^^^^^^^
response = self.full_dispatch_request() File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 335, in convert_list_objects_to_dict_json_by_attribute_key_default
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return Model_View_Base.convert_list_objects_to_dict_json_by_attribute_key(list_objects, getattr(obj_class, obj_class.FLAG_NAME_ATTR_OPTION_VALUE))
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rv = self.handle_user_exception(e) File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 323, in convert_list_objects_to_dict_json_by_attribute_key
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return {getattr(obj, key): obj.to_json() for obj in list_objects}
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function ^^^^^^^^^^^^^
return cors_after_request(app.make_response(f(*args, **kwargs))) File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product.py", line 346, in to_json
^^^^^^^^^^^^^^^^^^ self.ATTR_ID_PRODUCT_PERMUTATION: [permutation.to_json() for permutation in self.permutations],
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request ^^^^^^^^^^^^^^^^^^^^^
rv = self.dispatch_request() File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product_permutation.py", line 303, in to_json
^^^^^^^^^^^^^^^^^^^^^^^ self.FLAG_PRODUCT_IMAGE: [image.to_json() for image in self.images],
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request ^^^^^^^^^^^^^^^
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\image.py", line 99, in to_json
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **self.get_shared_json_attributes(self),
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 45, in stock_items ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return render_template('pages/store/_stock_items.html', model = model, datetime = datetime) File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\base.py", line 68, in get_shared_json_attributes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cls.FLAG_NAME_ATTR_OPTION_TEXT: object.NAME_ATTR_OPTION_TEXT,
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return _render(app, template, context) AttributeError: 'Image' object has no attribute 'NAME_ATTR_OPTION_TEXT'. Did you mean: 'FLAG_NAME_ATTR_OPTION_TEXT'?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render
rv = template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render
self.environment.handle_exception()
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception
raise rewrite_traceback_stack(source=source)

View File

@@ -1,46 +1,3 @@
Request: 127.0.0.1 GET http /store/stock_items?id_category=3&id_product=3&is_out_of_stock=false&quantity_min=&quantity_max= Host: 127.0.0.1:5000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Referer: http://127.0.0.1:5000/store/stock_items?id_category=3&id_product=&is_out_of_stock=false&quantity_min=&quantity_max=
Dnt: 1
Connection: keep-alive
Cookie: session=.eJytVlnPqzgS_SutSN1PnVz25ZOuZsgGJIEkhLC9ILBZzB6WLPTc_z4m3-2-_dCzSSOFYLtMnVOuclX9NguGPq1b1EXw2kXt7OO3GQgqP4Alqvyur9to9tG3Q_Trn5aH98bP1agMUDH7mEXwEbRwUSIIi6ivq65Effr3ZJIuQF3Ofp3FqO36KiixwpkZQfjCawj6YGjbqAIvH0ZxMBT97KMaiuItaqME1dVfCD4JkH-M_ckIAut9v__BsQIViiwQR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mLmJDEnSZPgP2jqg2EXNC14s2_fvv0TX22jag.ZwjUoA.pitPRgpTPJyCaDMIr0TPpBG_lIc
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Sec-Gpc: 1
Priority: u=0, i
Request data: b''
Traceback: Traceback (most recent call last):
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception on /store/stock_items [GET] Exception on /store/stock_items [GET]
Traceback (most recent call last): Traceback (most recent call last):
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
@@ -74,17 +31,48 @@ Traceback (most recent call last):
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 1, in top-level template code File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 1, in top-level template code
{% extends 'layouts/layout.html' %} {% extends 'layouts/layout.html' %}
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 326, in top-level template code
{% block page_body %}{% endblock %} {% block page_body %}{% endblock %}
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 127, in block 'page_body'
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template var products = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.category_list_filters.get_list_products()) | tojson | safe }};
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 335, in convert_list_objects_to_dict_json_by_attribute_key_default
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render return Model_View_Base.convert_list_objects_to_dict_json_by_attribute_key(list_objects, getattr(obj_class, obj_class.FLAG_NAME_ATTR_OPTION_VALUE))
rv = template.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 323, in convert_list_objects_to_dict_json_by_attribute_key
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render return {getattr(obj, key): obj.to_json() for obj in list_objects}
self.environment.handle_exception() ^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product.py", line 346, in to_json
self.ATTR_ID_PRODUCT_PERMUTATION: [permutation.to_json() for permutation in self.permutations],
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product_permutation.py", line 303, in to_json
self.FLAG_PRODUCT_IMAGE: [image.to_json() for image in self.images],
^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\image.py", line 99, in to_json
**self.get_shared_json_attributes(self),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\base.py", line 68, in get_shared_json_attributes
cls.FLAG_NAME_ATTR_OPTION_TEXT: object.NAME_ATTR_OPTION_TEXT,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Image' object has no attribute 'NAME_ATTR_OPTION_TEXT'. Did you mean: 'FLAG_NAME_ATTR_OPTION_TEXT'?
Server Error: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. Server Error: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Request: 127.0.0.1 GET http /store/stock_items? Host: 127.0.0.1:5000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Dnt: 1
Connection: keep-alive
Referer: http://127.0.0.1:5000/store/stock_items
Cookie: session=.eJytVlnPqzgS_SutSN1PnVz25ZOuZsgGJIEkhLC9ILBZzB6WLPTc_z4m3-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11BSY5H25lXekdYuTjoE-SJcVusbhBoB-mRu0Pht0iaYN70Aftm87n8AtLQzqmcP_BQ5Zi-VhgYooHAcELPBNCjvlb95URiF_ar03yC_z61vUzLf1MbfEPwOqHfXj-qbLDowgumurtcTQ57O4kWpZr2VxQ1iE-5yUdcv5RVq3xHvYqlU8bh_C_6dWGBgY97sYmZ8wogmLmJDEnSZPgP2jqg2EXNC14s2_fvv0TX22jag.ZwjUoA.pitPRgpTPJyCaDMIr0TPpBG_lIc
Upgrade-Insecure-Requests: 1

View File

@@ -1,11 +1,12 @@
Request: 127.0.0.1 GET http /store/stock_items?id_category=3&id_product=3&is_out_of_stock=false&quantity_min=&quantity_max= Host: 127.0.0.1:5000 Server Error: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Request: 127.0.0.1 GET http /store/categories? Host: 127.0.0.1:5000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5 Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd Accept-Encoding: gzip, deflate, br, zstd
Dnt: 1 Dnt: 1
@@ -33,36 +34,25 @@ Traceback: Traceback (most recent call last):
Request data: b'' Request data: b''
Traceback: Traceback (most recent call last): Traceback: Traceback (most recent call last):
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request() response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e) rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\product_category.py", line 56, in categories
model = Model_View_Store_Product_Category(form_filters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_product_category.py", line 49, in __init__
filters_product = Parameters_Product.from_filters_product_category(self.form_filters) filters_product = Parameters_Product.from_filters_product_category(self.form_filters)
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 40, in stock_items
model = Model_View_Store_Stock_Item(form_filters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_stock_item.py", line 89, in __init__
if product.id_category != self.form_filters.id_category.data and self.form_filters.id_category.data != '':
^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'id_category'
Exception on /store/stock_items [GET]
Traceback (most recent call last):
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -1,9 +1,9 @@
Request: 127.0.0.1 GET http /store/stock_items?id_category=3&id_product=3&is_out_of_stock=false&quantity_min=&quantity_max= Host: 127.0.0.1:5000 Request: 127.0.0.1 GET http /store/stock_items?id_category=3&id_product=&is_out_of_stock=false&quantity_min=&quantity_max= Host: 127.0.0.1:5000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5 Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd Accept-Encoding: gzip, deflate, br, zstd
@@ -33,15 +33,37 @@ Traceback: Traceback (most recent call last):
Request data: b'' Request data: b''
Traceback: Traceback (most recent call last): Traceback: Traceback (most recent call last):
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request() response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e) rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\stock_item.py", line 45, in stock_items
return render_template('pages/store/_stock_items.html', model = model, datetime = datetime)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template
return _render(app, template, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render
rv = template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render
self.environment.handle_exception()
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception
raise rewrite_traceback_stack(source=source) raise rewrite_traceback_stack(source=source)
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_stock_items.html", line 1, in top-level template code
{% extends 'layouts/layout.html' %} {% extends 'layouts/layout.html' %}
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 316, in top-level template code File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 316, in top-level template code
@@ -58,11 +80,24 @@ Traceback (most recent call last):
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
jinja2.exceptions.UndefinedError: 'currency' is undefined jinja2.exceptions.UndefinedError: 'currency' is undefined
Exception on /store/stock_items [GET] Exception on /store/categories [GET]
Traceback (most recent call last): Traceback (most recent call last):
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
response = self.full_dispatch_request() response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e) rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\product_category.py", line 56, in categories
model = Model_View_Store_Product_Category(form_filters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_product_category.py", line 49, in __init__

View File

@@ -51,8 +51,10 @@ class Base():
FLAG_URL: ClassVar[str] = 'url' FLAG_URL: ClassVar[str] = 'url'
FLAG_VALUE_LOCAL_VAT_EXCL: ClassVar[str] = 'value_local_vat_excl' FLAG_VALUE_LOCAL_VAT_EXCL: ClassVar[str] = 'value_local_vat_excl'
FLAG_VALUE_LOCAL_VAT_INCL: ClassVar[str] = 'value_local_vat_incl' FLAG_VALUE_LOCAL_VAT_INCL: ClassVar[str] = 'value_local_vat_incl'
"""
NAME_ATTR_OPTION_TEXT: ClassVar[str] = 'name-attribute-option-text' NAME_ATTR_OPTION_TEXT: ClassVar[str] = 'name-attribute-option-text'
NAME_ATTR_OPTION_VALUE: ClassVar[str] = 'name-attribute-option-value' NAME_ATTR_OPTION_VALUE: ClassVar[str] = 'name-attribute-option-value'
"""
@classmethod @classmethod
def output_bool(cls, value): def output_bool(cls, value):

View File

@@ -16,6 +16,7 @@ from extensions import db
import lib.argument_validation as av import lib.argument_validation as av
# external # external
from enum import Enum from enum import Enum
from typing import ClassVar
class Resolution_Level_Enum(Enum): class Resolution_Level_Enum(Enum):
@@ -48,6 +49,8 @@ class Resolution_Level_Enum(Enum):
class Image(db.Model, Store_Base): class Image(db.Model, Store_Base):
NAME_ATTR_OPTION_TEXT: ClassVar[str] = 'url'
NAME_ATTR_OPTION_VALUE: ClassVar[str] = 'id_image'
id_image = db.Column(db.Integer, primary_key=True) id_image = db.Column(db.Integer, primary_key=True)
id_product = db.Column(db.Integer) id_product = db.Column(db.Integer)
id_permutation = db.Column(db.Integer) id_permutation = db.Column(db.Integer)

View File

@@ -490,10 +490,10 @@ class Parameters_Product(Get_Many_Parameters_Base):
def from_form_filters_product_permutation(form): def from_form_filters_product_permutation(form):
# if not (form is Filters_Product_Permutation): raise ValueError(f'Invalid form type: {type(form)}') # if not (form is Filters_Product_Permutation): raise ValueError(f'Invalid form type: {type(form)}')
# av.val_instance(form, 'form', 'Parameters_Product.from_form', Filters_Product_Permutation) # av.val_instance(form, 'form', 'Parameters_Product.from_form', Filters_Product_Permutation)
has_category_filter = not (form.id_category.data == '0' or form.id_category.data == '') has_category_filter = not (form.id_category.data == '0' or form.id_category.data == '' or form.id_category.data is None)
has_product_filter = not (form.id_product.data == '0' or form.id_product.data == '') has_product_filter = not (form.id_product.data == '0' or form.id_product.data == '' or form.id_product.data is None)
get_permutations_stock_below_min = av.input_bool(form.is_out_of_stock.data, "is_out_of_stock", "Parameters_Product.from_form") get_permutations_stock_below_min = av.input_bool(form.is_out_of_stock.data, "is_out_of_stock", "Parameters_Product.from_form")
print(f'form question: {type(form.is_out_of_stock)}\nbool interpretted: {get_permutations_stock_below_min}\type form: {type(form)}') print(f'form question: {type(form.is_out_of_stock)}\nbool interpretted: {get_permutations_stock_below_min}\ntype form: {type(form)}')
return Parameters_Product( return Parameters_Product(
get_all_product_category = not has_category_filter, get_all_product_category = not has_category_filter,
get_inactive_product_category = False, get_inactive_product_category = False,
@@ -595,11 +595,11 @@ class Parameters_Product(Get_Many_Parameters_Base):
def from_filters_product_category(cls, filters_category): def from_filters_product_category(cls, filters_category):
return cls( return cls(
get_all_product_category = True, get_all_product_category = True,
get_inactive_product_category = filters_category.active, get_inactive_product_category = filters_category.active.data,
ids_product_category = '', ids_product_category = '',
get_all_product = True, get_all_product = True,
get_inactive_product = False, get_inactive_product = False,
ids_product = False, ids_product = '',
get_all_permutation = True, get_all_permutation = True,
get_inactive_permutation = False, get_inactive_permutation = False,
ids_permutation = '', ids_permutation = '',

View File

@@ -320,6 +320,8 @@ class Filters_Product_Category(Get_Many_Parameters_Base):
""" """
class Product_Category_Container(Store_Base): class Product_Category_Container(Store_Base):
NAME_ATTR_OPTION_TEXT: ClassVar[str] = ''
NAME_ATTR_OPTION_VALUE: ClassVar[str] = Store_Base.FLAG_ROWS
categories: list categories: list
def __init__(self): def __init__(self):
self.categories = [] self.categories = []

View File

@@ -22,7 +22,7 @@ from flask_wtf.recaptcha import RecaptchaField
class Filters_Product(FlaskForm): class Filters_Product(FlaskForm):
id_category = SelectField('Category', validators=[Optional()], choices=[('', 'All')]) id_category = SelectField('Category', validators=[Optional()], choices=[('', 'All')], default='')
is_not_empty = BooleanField('Not empty only?') is_not_empty = BooleanField('Not empty only?')
active = BooleanField("Active only?", default = True) active = BooleanField("Active only?", default = True)
@classmethod @classmethod

View File

@@ -26,8 +26,8 @@ from abc import ABCMeta, abstractmethod
class Filters_Product_Permutation(Form_Base): class Filters_Product_Permutation(Form_Base):
id_category = SelectField('Category', validators=[Optional()], choices=[('', 'All')]) id_category = SelectField('Category', validators=[Optional()], choices=[('', 'All')], default='')
id_product = SelectField('Product', validators=[Optional()], choices=[('', 'All')]) id_product = SelectField('Product', validators=[Optional()], choices=[('', 'All')], default='')
is_out_of_stock = BooleanField('Out of stock only?') is_out_of_stock = BooleanField('Out of stock only?')
quantity_min = FloatField('Min stock') quantity_min = FloatField('Min stock')
quantity_max = FloatField('Max stock') quantity_max = FloatField('Max stock')

View File

@@ -7,9 +7,9 @@ th, td {
#tableMain { #tableMain {
max-width: 90vw; max-width: 90vw;
} }
#tableMain thead tr th.category, #tableMain tbody tr td.category { #tableMain thead tr th.product_category, #tableMain tbody tr td.product_category {
width: 8vh; width: 12vh;
min-width: 8vh; min-width: 12vh;
} }
#tableMain thead tr th.product, #tableMain tbody tr td.product, #tableMain thead tr th.product, #tableMain tbody tr td.product,
#tableMain thead tr th.storage_location, #tableMain tbody tr td.storage_location { #tableMain thead tr th.storage_location, #tableMain tbody tr td.storage_location {
@@ -80,6 +80,6 @@ th, td {
#tableMain thead tr th.date_unsealed, #tableMain tbody tr td.date_unsealed, #tableMain thead tr th.date_unsealed, #tableMain tbody tr td.date_unsealed,
#tableMain thead tr th.date_expiration, #tableMain tbody tr td.date_expiration, #tableMain thead tr th.date_expiration, #tableMain tbody tr td.date_expiration,
#tableMain thead tr th.date_consumed, #tableMain tbody tr td.date_consumed { #tableMain thead tr th.date_consumed, #tableMain tbody tr td.date_consumed {
width: 17vh; width: 15vh;
min-width: 17vh; min-width: 15vh;
} }

View File

@@ -60,9 +60,9 @@ th, td {
#tableMain { #tableMain {
max-width: 90vw; max-width: 90vw;
} }
#tableMain thead tr th.category, #tableMain tbody tr td.category { #tableMain thead tr th.product_category, #tableMain tbody tr td.product_category {
width: 8vh; width: 12vh;
min-width: 8vh; min-width: 12vh;
} }
#tableMain thead tr th.product, #tableMain tbody tr td.product, #tableMain thead tr th.product, #tableMain tbody tr td.product,
#tableMain thead tr th.storage_location, #tableMain tbody tr td.storage_location { #tableMain thead tr th.storage_location, #tableMain tbody tr td.storage_location {
@@ -133,6 +133,6 @@ th, td {
#tableMain thead tr th.date_unsealed, #tableMain tbody tr td.date_unsealed, #tableMain thead tr th.date_unsealed, #tableMain tbody tr td.date_unsealed,
#tableMain thead tr th.date_expiration, #tableMain tbody tr td.date_expiration, #tableMain thead tr th.date_expiration, #tableMain tbody tr td.date_expiration,
#tableMain thead tr th.date_consumed, #tableMain tbody tr td.date_consumed { #tableMain thead tr th.date_consumed, #tableMain tbody tr td.date_consumed {
width: 17vh; width: 15vh;
min-width: 17vh; min-width: 15vh;
} }