Skip to content

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

Add Product to AttributeEntityType

IKarbowiak93bf66e97453
diff --git a/saleor/attribute/__init__.py b/saleor/attribute/__init__.py
index 6cdd392eb9..f7b85f3e7a 100644
--- a/saleor/attribute/__init__.py
+++ b/saleor/attribute/__init__.py
@@ -12,7 +12,7 @@ class AttributeInputType:
(FILE, "File"),
(REFERENCE, "Reference"),
]
- # list of the input types that can be used in variant selection
+ # list of the input types that can be used in variant selectionn
ALLOWED_IN_VARIANT_SELECTION = [DROPDOWN]
@@ -27,5 +27,6 @@ class AttributeEntityType:
"""Type of a reference entity type. Must match the name of the graphql type."""
PAGE = "Page"
+ PRODUCT = "Product"
- CHOICES = [(PAGE, "Page")]
+ CHOICES = [(PAGE, "Page"), (PRODUCT, "Product")]
diff --git a/saleor/attribute/migrations/0006_auto_20210105_1031.py b/saleor/attribute/migrations/0006_auto_20210105_1031.py
new file mode 100644
index 0000000000..55df14dd9c
--- /dev/null
+++ b/saleor/attribute/migrations/0006_auto_20210105_1031.py
@@ -0,0 +1,23 @@
+# Generated by Django 3.1.3 on 2021-01-05 10:31
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("attribute", "0005_add_assignedattributevalues"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="attribute",
+ name="entity_type",
+ field=models.CharField(
+ blank=True,
+ choices=[("Page", "Page"), ("Product", "Product")],
+ max_length=50,
+ null=True,
+ ),
+ ),
+ ]
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 647c7b5635..da7a481922 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -454,6 +454,7 @@ type AttributeDelete {
enum AttributeEntityTypeEnum {
PAGE
+ PRODUCT
}
type AttributeError {