feat(MySQL): Get Many stored procedures created for product variations with variation types and product prices with discounts and delivery options.
This commit is contained in:
116
app.log.2
116
app.log.2
@@ -1,35 +1,20 @@
|
||||
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)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
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
|
||||
model = Model_View_Store_Stock_Items(filters_stock_item=filters)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_stock_items.py", line 54, in __init__
|
||||
tmp_category_list_stock_item, errors = datastore_store.get_many_product(Filters_Product.from_filters_stock_item(filters_stock_item))
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product.py", line 812, in from_filters_stock_item
|
||||
return cls.from_form_filters_product_permutation(filters_stock_item)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product.py", line 691, in from_form_filters_product_permutation
|
||||
av.val_instance(form, 'form', 'Filters_Product.from_form', Filters_Product_Permutation)
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\lib\argument_validation.py", line 816, in val_instance
|
||||
raise ValueError(error_message)
|
||||
ValueError: Invalid Filters_Product.from_form argument argument form. Type = <class 'business_objects.store.stock_item.Stock_Item_Filters'>. Value = Stock_Item_Filters(get_all_category=True, get_inactive_category=False, get_first_category_only=False, ids_category='', get_all_product=True, get_inactive_product=False, get_first_product_only=False, ids_product='', get_all_permutation=True, get_inactive_permutation=False, get_first_permutation_only=False, ids_permutation='', get_all_stock_item=True, get_inactive_stock_item=False, get_first_stock_item_only=False, ids_stock_item='', get_all_region_storage=True, get_inactive_region_storage=False, get_first_region_storage_only=False, ids_region_storage='', get_all_plant_storage=True, get_inactive_plant_storage=False, get_first_plant_storage_only=False, ids_plant_storage='', get_all_location_storage=True, get_inactive_location_storage=False, get_first_location_storage_only=False, ids_location_storage='', date_received_to=None, get_sealed_stock_item_only=False, get_unsealed_stock_item_only=False, get_expired_stock_item_only=False, get_nonexpired_stock_item_only=False, get_consumed_stock_item_only=False, get_nonconsumed_stock_item_only=False)
|
||||
Exception on /store/products [GET]
|
||||
Traceback (most recent call last):
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context
|
||||
self.dialect.do_execute(
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute
|
||||
cursor.execute(statement, parameters)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
|
||||
res = self._query(mogrified_query)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
|
||||
db.query(q)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query
|
||||
_mysql.connection.query(self, query)
|
||||
MySQLdb.OperationalError: (1318, 'Incorrect number of arguments for PROCEDURE partsltd_prod.p_shop_get_many_product_variation; expected 8, got 10')
|
||||
|
||||
The above exception was the direct cause of the following exception:
|
||||
|
||||
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()
|
||||
@@ -46,18 +31,59 @@ Traceback (most recent call last):
|
||||
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
|
||||
model = Model_View_Store_Stock_Items(filters_stock_item=filters)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_stock_items.py", line 54, in __init__
|
||||
tmp_category_list_stock_item, errors = datastore_store.get_many_product(Filters_Product.from_filters_stock_item(filters_stock_item))
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product.py", line 813, in from_filters_stock_item
|
||||
return cls.from_form_filters_product_permutation(filters_stock_item)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\business_objects\store\product.py", line 692, in from_form_filters_product_permutation
|
||||
av.val_instance(form, 'form', 'Filters_Product.from_form', Form_Base)
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\lib\argument_validation.py", line 816, in val_instance
|
||||
raise ValueError(error_message)
|
||||
ValueError: Invalid Filters_Product.from_form argument argument form. Type = <class 'business_objects.store.stock_item.Stock_Item_Filters'>. Value = Stock_Item_Filters(get_all_category=True, get_inactive_category=False, get_first_category_only=False, ids_category='', get_all_product=True, get_inactive_product=False, get_first_product_only=False, ids_product='', get_all_permutation=True, get_inactive_permutation=False, get_first_permutation_only=False, ids_permutation='', get_all_stock_item=True, get_inactive_stock_item=False, get_first_stock_item_only=False, ids_stock_item='', get_all_region_storage=True, get_inactive_region_storage=False, get_first_region_storage_only=False, ids_region_storage='', get_all_plant_storage=True, get_inactive_plant_storage=False, get_first_plant_storage_only=False, ids_plant_storage='', get_all_location_storage=True, get_inactive_location_storage=False, get_first_location_storage_only=False, ids_location_storage='', date_received_to=None, get_sealed_stock_item_only=False, get_unsealed_stock_item_only=False, get_expired_stock_item_only=False, get_nonexpired_stock_item_only=False, get_consumed_stock_item_only=False, get_nonconsumed_stock_item_only=False)
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\product.py", line 113, in products
|
||||
model = Model_View_Store_Product(form_filters)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_product.py", line 115, in __init__
|
||||
self.variation_types, self.variations, errors = self.get_many_product_variation()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store.py", line 454, in get_many_product_variation
|
||||
variation_types, variations, errors = DataStore_Store_Base().get_many_product_variation(variation_filters)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_base.py", line 290, in get_many_product_variation
|
||||
result = cls.db_procedure_execute('p_shop_get_many_product_variation', argument_dict_list)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_base.py", line 95, in db_procedure_execute
|
||||
result = db.session.execute(proc_string, argument_dict_list)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\scoping.py", line 778, in execute
|
||||
return self._proxied.execute(
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2351, in execute
|
||||
return self._execute_internal(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2245, in _execute_internal
|
||||
result = conn.execute(
|
||||
^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1418, in execute
|
||||
return meth(
|
||||
^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\sql\elements.py", line 515, in _execute_on_connection
|
||||
return connection._execute_clauseelement(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1640, in _execute_clauseelement
|
||||
ret = self._execute_context(
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1846, in _execute_context
|
||||
return self._exec_single_context(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1986, in _exec_single_context
|
||||
self._handle_dbapi_exception(
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 2353, in _handle_dbapi_exception
|
||||
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context
|
||||
self.dialect.do_execute(
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute
|
||||
cursor.execute(statement, parameters)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
|
||||
res = self._query(mogrified_query)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
|
||||
db.query(q)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query
|
||||
_mysql.connection.query(self, query)
|
||||
sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1318, 'Incorrect number of arguments for PROCEDURE partsltd_prod.p_shop_get_many_product_variation; expected 8, got 10')
|
||||
[SQL: CALL p_shop_get_many_product_variation(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)]
|
||||
[parameters: (1, 0, True, False, False, '', True, False, False, '')]
|
||||
(Background on this error at: https://sqlalche.me/e/20/e3q8)
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user