BrandInfo.py 462 B

12345678910111213
  1. from db import MongoDao
  2. from data.bean.ProductInfo import ProductInfo
  3. class BrandInfo:
  4. def __init__(self, brand_name):
  5. self._dao = MongoDao("vbrand-ec")
  6. self.brand_name = brand_name
  7. self.product_list = [ProductInfo(record) for record in self._dao.get_records_by_query({"brandName": brand_name})]
  8. if __name__ == "__main__":
  9. brand_info = BrandInfo("李宁")
  10. for i in brand_info.product_list:
  11. print(i.image)