コード例 #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