Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Description field added to Product model

Artur Smęt03030ac759ca
diff --git a/saleor/product/models/base_products.py b/saleor/product/models/base_products.py
index bb17ea76a2..a8586376ec 100644
--- a/saleor/product/models/base_products.py
+++ b/saleor/product/models/base_products.py
@@ -43,6 +43,8 @@ class Product(Subtyped, ItemRange):
category = models.ForeignKey(
Category, verbose_name=pgettext_lazy('Product field', 'category'),
related_name='products')
+ description = models.TextField(
+ verbose_name=pgettext_lazy('Product field', 'description'))
collection = models.CharField(db_index=True, max_length=100,
null=True, blank=True)
diff --git a/utils/create_random_data.py b/utils/create_random_data.py
index c092fc8bc1..81a34778fe 100644
--- a/utils/create_random_data.py
+++ b/utils/create_random_data.py
@@ -50,6 +50,7 @@ def create_product(product_type, **kwargs):
'collection': collection,
'color': Color.objects.order_by('?')[0],
'weight': fake.random_digit(),
+ 'description': ''.join(fake.paragraphs())
}
defaults.update(kwargs)