fix relationship
This commit is contained in:
@@ -32,18 +32,18 @@ class Products(db.Model):
|
||||
banner = db.Column(db.String(100), nullable=True)
|
||||
|
||||
|
||||
members_products = relationship(
|
||||
"MembersProducts",
|
||||
primaryjoin="MembersProducts.product_id == Products.product_id",
|
||||
foreign_keys="MembersProducts.product_id",
|
||||
back_populates="MembersProducts",
|
||||
)
|
||||
# members_products = relationship(
|
||||
# "MembersProducts",
|
||||
# primaryjoin="MembersProducts.product_id == Products.product_id",
|
||||
# foreign_keys="MembersProducts.product_id",
|
||||
# back_populates="MembersProducts",
|
||||
# )
|
||||
|
||||
@classmethod
|
||||
def get_user_product_list(cls, member_id):
|
||||
|
||||
product_list = cls.query.filter_by(
|
||||
member_id=member_id,
|
||||
id>0,
|
||||
# status='active'
|
||||
).all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user