product list
This commit is contained in:
@@ -32,6 +32,16 @@ class MembersProducts(db.Model):
|
||||
added = db.Column(db.DateTime(timezone=True), server_default=func.now())
|
||||
updated = db.Column(db.DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_member_productlist_by_member_id(cls, member_id):
|
||||
member_products = cls.query.filter_by(member_id=str(member_id))
|
||||
|
||||
if not member_products:
|
||||
raise ValueError(f"Products for member_id = {member_id} not found")
|
||||
return member_products
|
||||
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Convert the Loan object to a dictionary format for JSON serialization.
|
||||
|
||||
Reference in New Issue
Block a user