Skip to content

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

Define collection module

Mira Szewczyk701c856b285e
diff --git a/saleor/product/models.py b/saleor/product/models.py
index de34a88084..2c1a3aa837 100644
--- a/saleor/product/models.py
+++ b/saleor/product/models.py
@@ -374,5 +374,15 @@ class VariantImage(models.Model):
'ProductVariant', related_name='variant_images',
on_delete=models.CASCADE)
image = models.ForeignKey(
- ProductImage, related_name='variant_images',
- on_delete=models.CASCADE)
+ ProductImage, related_name='variant_images', on_delete=models.CASCADE)
+
+
+@python_2_unicode_compatible
+class Collection(models.Model):
+ name = models.CharField(
+ pgettext_lazy('Collection field', 'name'), max_length=128)
+ products = models.ManyToManyField(Product)
+
+ def __str__(self):
+ return self.name
+