Skip to content

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

Rename model field

Mira Szewczyke7c527f0affa
diff --git a/saleor/dashboard/warehouse/forms.py b/saleor/dashboard/warehouse/forms.py
index 90602a1f65..b8d3969c25 100644
--- a/saleor/dashboard/warehouse/forms.py
+++ b/saleor/dashboard/warehouse/forms.py
@@ -9,7 +9,7 @@ class WarehouseForm(forms.ModelForm):
fields = [
"name",
"company_name",
- "shipping_region",
+ "shipping_zones",
"street_address",
"city",
"postal_code",
diff --git a/saleor/warehouse/migrations/0001_initial.py b/saleor/warehouse/migrations/0001_initial.py
index 6a1758bef7..0d9c1716a0 100644
--- a/saleor/warehouse/migrations/0001_initial.py
+++ b/saleor/warehouse/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 2.2.6 on 2019-11-07 11:58
+# Generated by Django 2.2.6 on 2019-11-08 14:20
import uuid
@@ -20,9 +20,7 @@ class Migration(migrations.Migration):
(
"uuid",
models.UUIDField(
- default=uuid.UUID("57f55712-10e6-4687-a406-123915c84d86"),
- primary_key=True,
- serialize=False,
+ default=uuid.uuid4, primary_key=True, serialize=False
),
),
(
@@ -37,19 +35,15 @@ class Migration(migrations.Migration):
"street_address",
models.CharField(max_length=256, verbose_name="Street name"),
),
- ("city", models.CharField(blank=True, max_length=256)),
+ ("city", models.CharField(max_length=256)),
(
"postal_code",
- models.CharField(
- blank=True, max_length=20, verbose_name="Zip code"
- ),
+ models.CharField(max_length=20, verbose_name="Zip code"),
),
("country", django_countries.fields.CountryField(max_length=2)),
(
"country_area",
- models.CharField(
- blank=True, max_length=128, verbose_name="State/province"
- ),
+ models.CharField(max_length=128, verbose_name="State/province"),
),
(
"email",
@@ -70,7 +64,7 @@ class Migration(migrations.Migration):
verbose_name="Phone number",
),
),
- ("shipping_region", models.ManyToManyField(to="shipping.ShippingZone")),
+ ("shipping_zones", models.ManyToManyField(to="shipping.ShippingZone")),
],
options={
"ordering": ("-name",),
diff --git a/saleor/warehouse/models.py b/saleor/warehouse/models.py
index d6f017db12..21b8da39ae 100644
--- a/saleor/warehouse/models.py
+++ b/saleor/warehouse/models.py
@@ -10,7 +10,7 @@ from saleor.shipping.models import ShippingZone
class Warehouse(models.Model):
- uuid = models.UUIDField(default=uuid.uuid4(), primary_key=True)
+ uuid = models.UUIDField(default=uuid.uuid4, primary_key=True)
name = models.CharField(
pgettext_lazy("Warehouse field description", "Warehouse name"), max_length=50
)
@@ -19,22 +19,18 @@ class Warehouse(models.Model):
max_length=100,
)
- shipping_region = models.ManyToManyField(ShippingZone)
+ shipping_zones = models.ManyToManyField(ShippingZone)
street_address = models.CharField(
pgettext_lazy("Warehouse field description", "Street name"), max_length=256
)
- city = models.CharField(max_length=256, blank=True)
+ city = models.CharField(max_length=256)
postal_code = models.CharField(
- pgettext_lazy("Warehouse field description", "Zip code"),
- max_length=20,
- blank=True,
+ pgettext_lazy("Warehouse field description", "Zip code"), max_length=20
)
country = CountryField()
country_area = models.CharField(
- pgettext_lazy("Warehouse field description", "State/province"),
- max_length=128,
- blank=True,
+ pgettext_lazy("Warehouse field description", "State/province"), max_length=128
)
email = models.EmailField(