示例#1
0
    def _create_sample_products(cls, shop, business_segment):
        """
        Create the sample products for the given business_segment
        """
        if business_segment not in BUSINESS_SEGMENTS:
            return None

        products = []

        for product_data in BUSINESS_SEGMENTS[business_segment]["products"]:
            product = create_sample_product(product_data["name"],
                                            product_data["description"],
                                            business_segment,
                                            product_data["image"], shop)
            products.append(product.pk)

        return products
示例#2
0
文件: views.py 项目: ruqaiya/shuup
    def _create_sample_products(cls, shop, business_segment):
        """
        Create the sample products for the given business_segment
        """
        if business_segment not in BUSINESS_SEGMENTS:
            return None

        products = []

        for product_data in BUSINESS_SEGMENTS[business_segment]["products"]:
            product = create_sample_product(product_data["name"],
                                            product_data["description"],
                                            business_segment,
                                            product_data["image"],
                                            shop)
            products.append(product.pk)

        return products