This commit is contained in:
CHIEFSOFT\ameye
2025-07-05 15:35:00 -04:00
parent 04444d2182
commit cb6f7397b6
3 changed files with 40 additions and 1 deletions
+9
View File
@@ -64,6 +64,15 @@ class Products(db.Model):
raise ValueError(f"No available Products")
return product_list
@classmethod
def get_product_by_product_id(cls, product_id):
"""
Get customer's active loans by loan_id.
"""
productItem = cls.query.filter_by(product_id = product_id).first()
if not productItem:
raise ValueError(f"pProduct with ID {product_id} does not exist.")
return productItem
def to_dict(self):
"""