Fix: Clean up Python comments and deprecated js code.

This commit is contained in:
2025-03-21 14:34:29 +00:00
parent a6cbf9a7b7
commit 85a3ec4c9f
20 changed files with 28 additions and 879 deletions

View File

@@ -10,11 +10,6 @@ Description:
Data model for store home view
"""
# IMPORTS
# VARIABLE INSTANTIATION
# METHODS
# IMPORTS
# internal
from models.model_view_store import Model_View_Store
# from routes import bp_home
@@ -23,37 +18,18 @@ from forms.forms import Form_Basket_Add, Form_Basket_Edit # Form_Product
# external
from typing import ClassVar
# VARIABLE INSTANTIATION
# CLASSES
class Model_View_Store_Home(Model_View_Store):
# Global constants
MAX_PRODUCTS_PER_CATEGORY: ClassVar[int] = -1
# Attributes
product_categories: list # (str)
product_categories: list
forms_product: dict
forms_basket: dict
# category_products: dict { category_enum_id: List[Product] }
# Attributes
@property
def title(self):
return 'Store Home'
def __init__(self, id_currency, id_region_delivery, is_included_VAT, hash_page_current=Model_View_Store.HASH_PAGE_STORE_HOME):
# Constructor
super().__init__(id_currency, id_region_delivery, is_included_VAT)
# self.categories = Model_View_Store_Home.get_many_product(self.db, get_all_category = True, get_all_product = True)
# self.get_many_product(get_all_category = True, get_all_product = True)
"""
self.forms_product = {}
for cat in self.product_categories:
for product in cat:
if len(list(product.variations.keys())) == 0:
new_form = Form_Product()
if new_form.validate_on_submit():
# Handle form submission
self.add_2_basket(product.id, )
self.forms[str(product.id)] = new_form
"""