Features: 1) Add sku field to multiple serializers and GraphQL object types for better product identification;
Fixes: 1) Remove unnecessary `IntegrityError` import in 0038_backfill_product_sku migration; Extra: 1) Minor formatting cleanup in migration files.
This commit is contained in:
parent
ec147984ab
commit
4e2c4c7ccb
5 changed files with 4 additions and 2 deletions
|
|
@ -507,6 +507,7 @@ class ProductType(DjangoObjectType):
|
||||||
interfaces = (relay.Node,)
|
interfaces = (relay.Node,)
|
||||||
fields = (
|
fields = (
|
||||||
"uuid",
|
"uuid",
|
||||||
|
"sku",
|
||||||
"category",
|
"category",
|
||||||
"brand",
|
"brand",
|
||||||
"tags",
|
"tags",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
from django.db import migrations, transaction, IntegrityError
|
from django.db import migrations, transaction
|
||||||
|
|
||||||
|
|
||||||
def generate_unique_sku(Product, make_candidate, taken):
|
def generate_unique_sku(Product, make_candidate, taken):
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("core", "0038_backfill_product_sku"),
|
("core", "0038_backfill_product_sku"),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -326,6 +326,7 @@ class ProductDetailSerializer(ModelSerializer):
|
||||||
model = Product
|
model = Product
|
||||||
fields = [
|
fields = [
|
||||||
"uuid",
|
"uuid",
|
||||||
|
"sku",
|
||||||
"name",
|
"name",
|
||||||
"description",
|
"description",
|
||||||
"partnumber",
|
"partnumber",
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ class ProductSimpleSerializer(ModelSerializer):
|
||||||
fields = [
|
fields = [
|
||||||
"uuid",
|
"uuid",
|
||||||
"name",
|
"name",
|
||||||
|
"sku",
|
||||||
"is_digital",
|
"is_digital",
|
||||||
"slug",
|
"slug",
|
||||||
"description",
|
"description",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue