From f428a21fdf4587b4632d44a729b77e88918e9b40 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 25 Jun 2025 11:43:11 -0400 Subject: [PATCH] product_list --- app/models/products.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/models/products.py b/app/models/products.py index 4be302c..c2d979d 100644 --- a/app/models/products.py +++ b/app/models/products.py @@ -41,7 +41,7 @@ class Products(db.Model): # ) @classmethod - def get_user_product_list(cls, member_id): + def get_user_product_list_bad(cls, member_id): # product_list = cls.query.filter_by( # id > 0 @@ -53,6 +53,17 @@ class Products(db.Model): logger.info(json_output) return json_output + @classmethod + def get_user_product_list(cls): + """ + Return all offers in dictionary format. + """ + product_list = cls.query.all() + + if not product_list: + raise ValueError(f"No available Products") + return product_list + def to_dict(self): """