def __init__(self, name, id, brand_id): self._productName=name if (id>0): from models import get_product_detail price=get_product_detail(id) self._price=price from models import get_product_image pic=get_product_image(id) self._pic_path=pic if (brand_id>0): from models import get_product_brand brand=get_product_brand(brand_id) self._brand=brand self._webUrl='' from models import get_product_link url=get_product_link(id) self._webUrl=url
def __init__(self, name, id, brand_id): self._productName=name if (id>0): from models import get_product_detail price=get_product_detail(id) self._price=price if (brand_id>0): from models import get_product_brand brand=get_product_brand(brand_id) self._brand=brand[0] self._pic='' self._webUrl=[] from models import get_product_link urls=get_product_link(id) for url in urls: self._webUrl.append(url)