Skip to content

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

Make new initial migrations

Marcin Gębala4bc9b4a6ca33
diff --git a/saleor/order/migrations/0001_initial.py b/saleor/order/migrations/0001_initial.py
new file mode 100644
index 0000000000..c001946d36
--- /dev/null
+++ b/saleor/order/migrations/0001_initial.py
@@ -0,0 +1,131 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+import django.db.models.deletion
+from django.conf import settings
+import django.utils.timezone
+import django_prices.models
+import django.core.validators
+import satchless.item
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('product', '0001_initial'),
+ ('userprofile', '__first__'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='DeliveryGroup',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('status', models.CharField(default='new', max_length=32, verbose_name='delivery status', choices=[('new', 'Processing'), ('cancelled', 'Cancelled'), ('shipped', 'Shipped')])),
+ ('shipping_required', models.BooleanField(default=True, verbose_name='shipping required')),
+ ('shipping_price', django_prices.models.PriceField(decimal_places=4, default=0, editable=False, currency=b'USD', max_digits=12, verbose_name='shipping price')),
+ ],
+ bases=(models.Model, satchless.item.ItemSet),
+ ),
+ migrations.CreateModel(
+ name='Order',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('status', models.CharField(default='new', max_length=32, verbose_name='order status', choices=[('new', 'Processing'), ('cancelled', 'Cancelled'), ('payment-pending', 'Waiting for payment'), ('fully-paid', 'Fully paid'), ('shipped', 'Shipped')])),
+ ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
+ ('last_status_change', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last status change', editable=False)),
+ ('tracking_client_id', models.CharField(max_length=36, editable=False, blank=True)),
+ ('shipping_method', models.CharField(max_length=255, verbose_name='Delivery method', blank=True)),
+ ('anonymous_user_email', models.EmailField(default='', max_length=254, editable=False, blank=True)),
+ ('token', models.CharField(unique=True, max_length=36, verbose_name='token')),
+ ('billing_address', models.ForeignKey(related_name='+', editable=False, to='userprofile.Address')),
+ ('shipping_address', models.ForeignKey(related_name='+', editable=False, to='userprofile.Address', null=True)),
+ ('user', models.ForeignKey(related_name='orders', verbose_name='user', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
+ ],
+ options={
+ 'ordering': ('-last_status_change',),
+ },
+ bases=(models.Model, satchless.item.ItemSet),
+ ),
+ migrations.CreateModel(
+ name='OrderedItem',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('product_name', models.CharField(max_length=128, verbose_name='product name')),
+ ('product_sku', models.CharField(max_length=32, verbose_name='sku')),
+ ('quantity', models.IntegerField(verbose_name='quantity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(999)])),
+ ('unit_price_net', models.DecimalField(verbose_name='unit price (net)', max_digits=12, decimal_places=4)),
+ ('unit_price_gross', models.DecimalField(verbose_name='unit price (gross)', max_digits=12, decimal_places=4)),
+ ('delivery_group', models.ForeignKey(related_name='items', editable=False, to='order.DeliveryGroup')),
+ ('product', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='product', blank=True, to='product.Product', null=True)),
+ ],
+ bases=(models.Model, satchless.item.ItemLine),
+ ),
+ migrations.CreateModel(
+ name='OrderHistoryEntry',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last history change', editable=False)),
+ ('status', models.CharField(max_length=32, verbose_name='order status', choices=[('new', 'Processing'), ('cancelled', 'Cancelled'), ('payment-pending', 'Waiting for payment'), ('fully-paid', 'Fully paid'), ('shipped', 'Shipped')])),
+ ('comment', models.CharField(default='', max_length=100, blank=True)),
+ ('order', models.ForeignKey(related_name='history', to='order.Order')),
+ ('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True)),
+ ],
+ options={
+ 'ordering': ['date'],
+ },
+ ),
+ migrations.CreateModel(
+ name='OrderNote',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('date', models.DateTimeField(auto_now_add=True)),
+ ('content', models.CharField(max_length=250)),
+ ('order', models.ForeignKey(related_name='notes', to='order.Order')),
+ ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Payment',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('variant', models.CharField(max_length=255)),
+ ('status', models.CharField(default='waiting', max_length=10, choices=[('waiting', 'Waiting for confirmation'), ('preauth', 'Pre-authorized'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected'), ('refunded', 'Refunded'), ('error', 'Error'), ('input', 'Input')])),
+ ('fraud_status', models.CharField(default='unknown', max_length=10, verbose_name='fraud check', choices=[('unknown', 'Unknown'), ('accept', 'Passed'), ('reject', 'Rejected'), ('review', 'Review')])),
+ ('fraud_message', models.TextField(default='', blank=True)),
+ ('created', models.DateTimeField(auto_now_add=True)),
+ ('modified', models.DateTimeField(auto_now=True)),
+ ('transaction_id', models.CharField(max_length=255, blank=True)),
+ ('currency', models.CharField(max_length=10)),
+ ('total', models.DecimalField(default='0.0', max_digits=9, decimal_places=2)),
+ ('delivery', models.DecimalField(default='0.0', max_digits=9, decimal_places=2)),
+ ('tax', models.DecimalField(default='0.0', max_digits=9, decimal_places=2)),
+ ('description', models.TextField(default='', blank=True)),
+ ('billing_first_name', models.CharField(max_length=256, blank=True)),
+ ('billing_last_name', models.CharField(max_length=256, blank=True)),
+ ('billing_address_1', models.CharField(max_length=256, blank=True)),
+ ('billing_address_2', models.CharField(max_length=256, blank=True)),
+ ('billing_city', models.CharField(max_length=256, blank=True)),
+ ('billing_postcode', models.CharField(max_length=256, blank=True)),
+ ('billing_country_code', models.CharField(max_length=2, blank=True)),
+ ('billing_country_area', models.CharField(max_length=256, blank=True)),
+ ('billing_email', models.EmailField(max_length=254, blank=True)),
+ ('customer_ip_address', models.IPAddressField(blank=True)),
+ ('extra_data', models.TextField(default='', blank=True)),
+ ('message', models.TextField(default='', blank=True)),
+ ('token', models.CharField(default='', max_length=36, blank=True)),
+ ('captured_amount', models.DecimalField(default='0.0', max_digits=9, decimal_places=2)),
+ ('order', models.ForeignKey(related_name='payments', to='order.Order')),
+ ],
+ options={
+ 'abstract': False,
+ },
+ ),
+ migrations.AddField(
+ model_name='deliverygroup',
+ name='order',
+ field=models.ForeignKey(related_name='groups', editable=False, to='order.Order'),
+ ),
+ ]
diff --git a/saleor/order/migrations/__init__.py b/saleor/order/migrations/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/saleor/product/migrations/0001_initial.py b/saleor/product/migrations/0001_initial.py
index fc03606cec..83360fcc03 100644
--- a/saleor/product/migrations/0001_initial.py
+++ b/saleor/product/migrations/0001_initial.py
@@ -2,10 +2,12 @@
from __future__ import unicode_literals
from django.db import models, migrations
-from decimal import Decimal
import versatileimagefield.fields
-import django_prices.models
+import jsonfield.fields
+from decimal import Decimal
+import saleor.product.models.fields
import django.core.validators
+import django_prices.models
import satchless.item
@@ -16,13 +18,13 @@ class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
- name='BagVariant',
+ name='AttributeChoiceValue',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('stock', models.IntegerField(default=Decimal('1'), verbose_name='stock', validators=[django.core.validators.MinValueValidator(0)])),
- ('sku', models.CharField(unique=True, max_length=32, verbose_name='SKU')),
+ ('display', models.CharField(max_length=100)),
+ ('color', models.CharField(blank=True, max_length=7, validators=[django.core.validators.RegexValidator('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$')])),
+ ('image', versatileimagefield.fields.VersatileImageField(null=True, upload_to='attributes', blank=True)),
],
- bases=(models.Model, satchless.item.StockedItem, satchless.item.Item),
),
migrations.CreateModel(
name='Category',
@@ -31,6 +33,7 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=128, verbose_name='name')),
('slug', models.SlugField(unique=True, verbose_name='slug')),
('description', models.TextField(verbose_name='description', blank=True)),
+ ('hidden', models.BooleanField(default=False, verbose_name='hidden')),
('lft', models.PositiveIntegerField(editable=False, db_index=True)),
('rght', models.PositiveIntegerField(editable=False, db_index=True)),
('tree_id', models.PositiveIntegerField(editable=False, db_index=True)),
@@ -41,20 +44,12 @@ class Migration(migrations.Migration):
'verbose_name_plural': 'categories',
},
),
- migrations.CreateModel(
- name='Color',
- fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('name', models.CharField(max_length=100, verbose_name='name')),
- ('color', models.CharField(max_length=6, verbose_name='HEX value')),
- ],
- ),
migrations.CreateModel(
name='FixedProductDiscount',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=255)),
- ('discount', django_prices.models.PriceField(currency=b'USD', verbose_name='discount value', max_digits=12, decimal_places=4)),
+ ('discount', django_prices.models.PriceField(currency=b'USD', verbose_name='discount value', max_digits=12, decimal_places=2)),
],
),
migrations.CreateModel(
@@ -63,67 +58,69 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=128, verbose_name='name')),
('description', models.TextField(verbose_name='description')),
- ('collection', models.CharField(db_index=True, max_length=100, blank=True)),
+ ('price', django_prices.models.PriceField(currency=b'USD', verbose_name='price', max_digits=12, decimal_places=2)),
+ ('weight', saleor.product.models.fields.WeightField(unit=b'lb', verbose_name='weight', max_digits=6, decimal_places=2)),
+ ('available_on', models.DateField(null=True, verbose_name='available on', blank=True)),
],
bases=(models.Model, satchless.item.ItemRange),
),
migrations.CreateModel(
- name='ProductImage',
+ name='ProductAttribute',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('image', versatileimagefield.fields.VersatileImageField(upload_to='products')),
- ('ppoi', versatileimagefield.fields.PPOIField(default='0.5x0.5', max_length=20, editable=False)),
- ('alt', models.CharField(max_length=128, verbose_name='alternative text', blank=True)),
+ ('name', models.SlugField(unique=True, verbose_name='name')),
+ ('display', models.CharField(max_length=100, verbose_name='display')),
],
options={
- 'ordering': ['id'],
+ 'ordering': ['name'],
},
),
migrations.CreateModel(
- name='ShirtVariant',
+ name='ProductImage',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('stock', models.IntegerField(default=Decimal('1'), verbose_name='stock', validators=[django.core.validators.MinValueValidator(0)])),
- ('sku', models.CharField(unique=True, max_length=32, verbose_name='SKU')),
- ('size', models.CharField(max_length=3, verbose_name='size', choices=[('xs', 'XS'), ('s', 'S'), ('m', 'M'), ('l', 'L'), ('xl', 'XL'), ('xxl', 'XXL')])),
+ ('image', versatileimagefield.fields.VersatileImageField(upload_to='products')),
+ ('ppoi', versatileimagefield.fields.PPOIField(default='0.5x0.5', max_length=20, editable=False)),
+ ('alt', models.CharField(max_length=128, verbose_name='short description', blank=True)),
+ ('order', models.PositiveIntegerField(editable=False)),
+ ('product', models.ForeignKey(related_name='images', to='product.Product')),
],
- bases=(models.Model, satchless.item.StockedItem, satchless.item.Item),
+ options={
+ 'ordering': ['order'],
+ },
),
migrations.CreateModel(
- name='Bag',
+ name='ProductVariant',
fields=[
- ('product_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='product.Product')),
- ('weight', models.DecimalField(max_digits=6, decimal_places=2)),
- ('length', models.DecimalField(default=0, max_digits=6, decimal_places=2, blank=True)),
- ('width', models.DecimalField(default=0, max_digits=6, decimal_places=2, blank=True)),
- ('depth', models.DecimalField(default=0, max_digits=6, decimal_places=2, blank=True)),
- ('price', django_prices.models.PriceField(currency=b'USD', verbose_name='price', max_digits=12, decimal_places=4)),
- ('color', models.ForeignKey(to='product.Color')),
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('sku', models.CharField(unique=True, max_length=32, verbose_name='SKU')),
+ ('name', models.CharField(max_length=100, verbose_name='variant name', blank=True)),
+ ('price_override', django_prices.models.PriceField(decimal_places=2, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='price override')),
+ ('weight_override', saleor.product.models.fields.WeightField(decimal_places=2, max_digits=6, blank=True, null=True, verbose_name='weight override', unit=b'lb')),
+ ('attributes', jsonfield.fields.JSONField(default={}, verbose_name='attributes')),
+ ('product', models.ForeignKey(related_name='variants', to='product.Product')),
],
- bases=('product.product', models.Model),
+ bases=(models.Model, satchless.item.Item),
),
migrations.CreateModel(
- name='Shirt',
+ name='Stock',
fields=[
- ('product_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='product.Product')),
- ('weight', models.DecimalField(max_digits=6, decimal_places=2)),
- ('length', models.DecimalField(default=0, max_digits=6, decimal_places=2, blank=True)),
- ('width', models.DecimalField(default=0, max_digits=6, decimal_places=2, blank=True)),
- ('depth', models.DecimalField(default=0, max_digits=6, decimal_places=2, blank=True)),
- ('price', django_prices.models.PriceField(currency=b'USD', verbose_name='price', max_digits=12, decimal_places=4)),
- ('color', models.ForeignKey(to='product.Color')),
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('location', models.CharField(max_length=100, verbose_name='location')),
+ ('quantity', models.IntegerField(default=Decimal('1'), verbose_name='quantity', validators=[django.core.validators.MinValueValidator(0)])),
+ ('cost_price', django_prices.models.PriceField(decimal_places=2, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='cost price')),
+ ('variant', models.ForeignKey(related_name='stock', verbose_name='variant', to='product.ProductVariant')),
],
- bases=('product.product', models.Model),
),
migrations.AddField(
- model_name='productimage',
- name='product',
- field=models.ForeignKey(related_name='images', to='product.Product'),
+ model_name='product',
+ name='attributes',
+ field=models.ManyToManyField(related_name='products', null=True, to='product.ProductAttribute', blank=True),
),
migrations.AddField(
model_name='product',
- name='category',
- field=models.ForeignKey(related_name='products', verbose_name='category', to='product.Category'),
+ name='categories',
+ field=models.ManyToManyField(related_name='products', verbose_name='categories', to='product.Category'),
),
migrations.AddField(
model_name='fixedproductdiscount',
@@ -131,13 +128,12 @@ class Migration(migrations.Migration):
field=models.ManyToManyField(to='product.Product', blank=True),
),
migrations.AddField(
- model_name='shirtvariant',
- name='product',
- field=models.ForeignKey(related_name='variants', to='product.Shirt'),
+ model_name='attributechoicevalue',
+ name='attribute',
+ field=models.ForeignKey(related_name='values', to='product.ProductAttribute'),
),
- migrations.AddField(
- model_name='bagvariant',
- name='product',
- field=models.ForeignKey(related_name='variants', to='product.Bag'),
+ migrations.AlterUniqueTogether(
+ name='stock',
+ unique_together=set([('variant', 'location')]),
),
]
diff --git a/saleor/product/migrations/0002_productimage_order.py b/saleor/product/migrations/0002_productimage_order.py
deleted file mode 100644
index a7c5eb7376..0000000000
--- a/saleor/product/migrations/0002_productimage_order.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0001_initial'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='productimage',
- name='order',
- field=models.PositiveIntegerField(default=0, editable=False),
- preserve_default=False,
- ),
- ]
diff --git a/saleor/product/migrations/0003_auto_20150610_0554.py b/saleor/product/migrations/0003_auto_20150610_0554.py
deleted file mode 100644
index b52f0d9293..0000000000
--- a/saleor/product/migrations/0003_auto_20150610_0554.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0002_productimage_order'),
- ]
-
- operations = [
- migrations.AlterModelOptions(
- name='productimage',
- options={'ordering': ['order']},
- ),
- migrations.RemoveField(
- model_name='product',
- name='category',
- ),
- migrations.AddField(
- model_name='product',
- name='categories',
- field=models.ManyToManyField(related_name='products', verbose_name='category', to='product.Category'),
- ),
- ]
diff --git a/saleor/product/migrations/0004_auto_20150616_0327.py b/saleor/product/migrations/0004_auto_20150616_0327.py
deleted file mode 100644
index 2af5cd0ce3..0000000000
--- a/saleor/product/migrations/0004_auto_20150616_0327.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-from decimal import Decimal
-import django_prices.models
-import django.core.validators
-import satchless.item
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0003_auto_20150610_0554'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='GenericProduct',
- fields=[
- ('product_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='product.Product')),
- ('weight', models.DecimalField(max_digits=6, decimal_places=2)),
- ('price', django_prices.models.PriceField(currency=b'USD', verbose_name='price', max_digits=12, decimal_places=4)),
- ],
- bases=('product.product', models.Model),
- ),
- migrations.CreateModel(
- name='GenericVariant',
- fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('stock', models.IntegerField(default=Decimal('1'), verbose_name='stock', validators=[django.core.validators.MinValueValidator(0)])),
- ('sku', models.CharField(unique=True, max_length=32, verbose_name='SKU')),
- ('name', models.CharField(max_length=100, verbose_name='name')),
- ('product', models.ForeignKey(related_name='variants', to='product.GenericProduct')),
- ],
- bases=(models.Model, satchless.item.StockedItem, satchless.item.Item),
- ),
- migrations.RemoveField(
- model_name='bag',
- name='depth',
- ),
- migrations.RemoveField(
- model_name='bag',
- name='length',
- ),
- migrations.RemoveField(
- model_name='bag',
- name='width',
- ),
- migrations.RemoveField(
- model_name='shirt',
- name='depth',
- ),
- migrations.RemoveField(
- model_name='shirt',
- name='length',
- ),
- migrations.RemoveField(
- model_name='shirt',
- name='width',
- ),
- migrations.AlterField(
- model_name='product',
- name='categories',
- field=models.ManyToManyField(related_name='products', verbose_name='categories', to='product.Category'),
- ),
- migrations.AlterField(
- model_name='productimage',
- name='alt',
- field=models.CharField(max_length=128, verbose_name='short description', blank=True),
- ),
- ]
diff --git a/saleor/product/migrations/0005_auto_20150616_0354.py b/saleor/product/migrations/0005_auto_20150616_0354.py
deleted file mode 100644
index 030b808cb9..0000000000
--- a/saleor/product/migrations/0005_auto_20150616_0354.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0004_auto_20150616_0327'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='bag',
- name='color',
- ),
- migrations.RemoveField(
- model_name='bag',
- name='product_ptr',
- ),
- migrations.RemoveField(
- model_name='bagvariant',
- name='product',
- ),
- migrations.RemoveField(
- model_name='shirt',
- name='color',
- ),
- migrations.RemoveField(
- model_name='shirt',
- name='product_ptr',
- ),
- migrations.RemoveField(
- model_name='shirtvariant',
- name='product',
- ),
- migrations.DeleteModel(
- name='Bag',
- ),
- migrations.DeleteModel(
- name='BagVariant',
- ),
- migrations.DeleteModel(
- name='Color',
- ),
- migrations.DeleteModel(
- name='Shirt',
- ),
- migrations.DeleteModel(
- name='ShirtVariant',
- ),
- ]
diff --git a/saleor/product/migrations/0006_auto_20150616_0647.py b/saleor/product/migrations/0006_auto_20150616_0647.py
deleted file mode 100644
index 3f934a4108..0000000000
--- a/saleor/product/migrations/0006_auto_20150616_0647.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-from decimal import Decimal
-import django_prices.models
-import django.core.validators
-import satchless.item
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0005_auto_20150616_0354'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='ProductVariant',
- fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('name', models.CharField(max_length=100, verbose_name='name')),
- ('sku', models.CharField(max_length=32, verbose_name='SKU')),
- ('price', django_prices.models.PriceField(decimal_places=4, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='price')),
- ],
- bases=(models.Model, satchless.item.Item),
- ),
- migrations.RemoveField(
- model_name='genericproduct',
- name='price',
- ),
- migrations.RemoveField(
- model_name='genericvariant',
- name='id',
- ),
- migrations.RemoveField(
- model_name='genericvariant',
- name='name',
- ),
- migrations.RemoveField(
- model_name='genericvariant',
- name='product',
- ),
- migrations.RemoveField(
- model_name='genericvariant',
- name='sku',
- ),
- migrations.AddField(
- model_name='genericproduct',
- name='stock',
- field=models.IntegerField(default=Decimal('1'), verbose_name='stock', validators=[django.core.validators.MinValueValidator(0)]),
- ),
- migrations.AddField(
- model_name='product',
- name='price',
- field=django_prices.models.PriceField(default=0, currency=b'USD', verbose_name='price', max_digits=12, decimal_places=4),
- preserve_default=False,
- ),
- migrations.AddField(
- model_name='product',
- name='sku',
- field=models.CharField(default='', max_length=32, verbose_name='SKU'),
- preserve_default=False,
- ),
- migrations.AddField(
- model_name='productvariant',
- name='product',
- field=models.ForeignKey(related_name='variants', to='product.Product'),
- ),
- migrations.AddField(
- model_name='genericvariant',
- name='productvariant_ptr',
- field=models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, default='', serialize=False, to='product.ProductVariant'),
- preserve_default=False,
- ),
- ]
diff --git a/saleor/product/migrations/0007_auto_20150616_0852.py b/saleor/product/migrations/0007_auto_20150616_0852.py
deleted file mode 100644
index f1c89cfe54..0000000000
--- a/saleor/product/migrations/0007_auto_20150616_0852.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-from decimal import Decimal
-import django.core.validators
-import django_prices.models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0006_auto_20150616_0647'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='Stock',
- fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('stock', models.IntegerField(default=Decimal('1'), verbose_name='stock', validators=[django.core.validators.MinValueValidator(0)])),
- ('location', models.CharField(max_length=100, verbose_name='location')),
- ('cost_price', django_prices.models.PriceField(decimal_places=4, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='cost price')),
- ('product', models.ForeignKey(verbose_name='product', to='product.Product')),
- ('variant', models.ForeignKey(verbose_name='variant', blank=True, to='product.ProductVariant', null=True)),
- ],
- ),
- migrations.AlterUniqueTogether(
- name='stock',
- unique_together=set([('product', 'variant', 'stock')]),
- ),
- ]
diff --git a/saleor/product/migrations/0008_auto_20150617_0406.py b/saleor/product/migrations/0008_auto_20150617_0406.py
deleted file mode 100644
index ecdf2bdf79..0000000000
--- a/saleor/product/migrations/0008_auto_20150617_0406.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-from decimal import Decimal
-import django.core.validators
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0007_auto_20150616_0852'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='stock',
- name='quantity',
- field=models.IntegerField(default=Decimal('1'), verbose_name='quantity', validators=[django.core.validators.MinValueValidator(0)]),
- ),
- migrations.AlterField(
- model_name='stock',
- name='product',
- field=models.ForeignKey(editable=False, to='product.Product', verbose_name='product'),
- ),
- migrations.AlterUniqueTogether(
- name='stock',
- unique_together=set([('product', 'variant', 'location')]),
- ),
- migrations.RemoveField(
- model_name='stock',
- name='stock',
- ),
- ]
diff --git a/saleor/product/migrations/0009_auto_20150617_0507.py b/saleor/product/migrations/0009_auto_20150617_0507.py
deleted file mode 100644
index 899cbe8d1e..0000000000
--- a/saleor/product/migrations/0009_auto_20150617_0507.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0008_auto_20150617_0406'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='genericproduct',
- name='stock',
- ),
- migrations.RemoveField(
- model_name='genericvariant',
- name='stock',
- ),
- migrations.AlterField(
- model_name='stock',
- name='product',
- field=models.ForeignKey(related_name='stock', verbose_name='product', to='product.Product'),
- ),
- migrations.AlterField(
- model_name='stock',
- name='variant',
- field=models.ForeignKey(related_name='stock', verbose_name='variant', blank=True, to='product.ProductVariant', null=True),
- ),
- ]
diff --git a/saleor/product/migrations/0010_genericvariant_weight.py b/saleor/product/migrations/0010_genericvariant_weight.py
deleted file mode 100644
index 721716bf0a..0000000000
--- a/saleor/product/migrations/0010_genericvariant_weight.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0009_auto_20150617_0507'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='genericvariant',
- name='weight',
- field=models.DecimalField(default=1, max_digits=6, decimal_places=2),
- preserve_default=False,
- ),
- ]
diff --git a/saleor/product/migrations/0011_auto_20150618_0938.py b/saleor/product/migrations/0011_auto_20150618_0938.py
deleted file mode 100644
index 19446c632c..0000000000
--- a/saleor/product/migrations/0011_auto_20150618_0938.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0010_genericvariant_weight'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='product',
- name='price',
- ),
- migrations.RemoveField(
- model_name='product',
- name='sku',
- ),
- migrations.AlterField(
- model_name='stock',
- name='variant',
- field=models.ForeignKey(related_name='stock', verbose_name='variant', to='product.ProductVariant'),
- ),
- migrations.AlterUniqueTogether(
- name='stock',
- unique_together=set([('variant', 'location')]),
- ),
- ]
diff --git a/saleor/product/migrations/0012_remove_stock_product.py b/saleor/product/migrations/0012_remove_stock_product.py
deleted file mode 100644
index af07f02c24..0000000000
--- a/saleor/product/migrations/0012_remove_stock_product.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0011_auto_20150618_0938'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='stock',
- name='product',
- ),
- ]
diff --git a/saleor/product/migrations/0013_product_price.py b/saleor/product/migrations/0013_product_price.py
deleted file mode 100644
index 903bae7727..0000000000
--- a/saleor/product/migrations/0013_product_price.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django_prices.models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0012_remove_stock_product'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='product',
- name='price',
- field=django_prices.models.PriceField(decimal_places=4, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='price'),
- ),
- ]
diff --git a/saleor/product/migrations/0014_auto_20150622_0623.py b/saleor/product/migrations/0014_auto_20150622_0623.py
deleted file mode 100644
index c3733d4243..0000000000
--- a/saleor/product/migrations/0014_auto_20150622_0623.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django_prices.models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0013_product_price'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='genericproduct',
- name='weight',
- ),
- migrations.RemoveField(
- model_name='genericvariant',
- name='weight',
- ),
- migrations.RemoveField(
- model_name='productvariant',
- name='price',
- ),
- migrations.AddField(
- model_name='product',
- name='weight',
- field=models.DecimalField(default=0, verbose_name='weight', max_digits=6, decimal_places=2),
- preserve_default=False,
- ),
- migrations.AddField(
- model_name='productvariant',
- name='price_override',
- field=django_prices.models.PriceField(decimal_places=4, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='price override'),
- ),
- migrations.AddField(
- model_name='productvariant',
- name='weight_override',
- field=models.DecimalField(null=True, verbose_name='weight override', max_digits=6, decimal_places=2, blank=True),
- ),
- migrations.AlterField(
- model_name='product',
- name='price',
- field=django_prices.models.PriceField(default=0, currency=b'USD', verbose_name='price', max_digits=12, decimal_places=4),
- preserve_default=False,
- ),
- ]
diff --git a/saleor/product/migrations/0015_auto_20150622_0646.py b/saleor/product/migrations/0015_auto_20150622_0646.py
deleted file mode 100644
index 72ddb75652..0000000000
--- a/saleor/product/migrations/0015_auto_20150622_0646.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0014_auto_20150622_0623'),
- ]
-
- operations = [
- migrations.DeleteModel(
- name='GenericProduct',
- ),
- migrations.DeleteModel(
- name='GenericVariant',
- ),
- ]
diff --git a/saleor/product/migrations/0016_auto_20150622_0808.py b/saleor/product/migrations/0016_auto_20150622_0808.py
deleted file mode 100644
index 9f5d04a771..0000000000
--- a/saleor/product/migrations/0016_auto_20150622_0808.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0015_auto_20150622_0646'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='AttributeValue',
- fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('name', models.CharField(max_length=100)),
- ('display', models.CharField(max_length=100)),
- ],
- ),
- migrations.CreateModel(
- name='ProductAttribute',
- fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('name', models.CharField(max_length=100)),
- ('display', models.CharField(max_length=100)),
- ],
- ),
- migrations.AddField(
- model_name='attributevalue',
- name='attribute',
- field=models.ForeignKey(related_name='values', to='product.ProductAttribute'),
- ),
- migrations.AddField(
- model_name='product',
- name='attributes',
- field=models.ManyToManyField(related_name='products', to='product.ProductAttribute'),
- ),
- ]
diff --git a/saleor/product/migrations/0017_productvariant_attributes.py b/saleor/product/migrations/0017_productvariant_attributes.py
deleted file mode 100644
index c0eb449fe1..0000000000
--- a/saleor/product/migrations/0017_productvariant_attributes.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import jsonfield.fields
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0016_auto_20150622_0808'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='productvariant',
- name='attributes',
- field=jsonfield.fields.JSONField(verbose_name='attributes', blank=True),
- ),
- ]
diff --git a/saleor/product/migrations/0018_auto_20150623_0508.py b/saleor/product/migrations/0018_auto_20150623_0508.py
deleted file mode 100644
index 86fdb162b8..0000000000
--- a/saleor/product/migrations/0018_auto_20150623_0508.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0017_productvariant_attributes'),
- ]
-
- operations = [
- migrations.RenameModel(
- old_name='AttributeValue',
- new_name='AttributeChoiceValue',
- ),
- migrations.AlterField(
- model_name='product',
- name='attributes',
- field=models.ManyToManyField(related_name='products', null=True, to='product.ProductAttribute', blank=True),
- ),
- ]
diff --git a/saleor/product/migrations/0019_auto_20150623_0704.py b/saleor/product/migrations/0019_auto_20150623_0704.py
deleted file mode 100644
index c08cc5a07e..0000000000
--- a/saleor/product/migrations/0019_auto_20150623_0704.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0018_auto_20150623_0508'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='attributechoicevalue',
- name='name',
- ),
- migrations.RemoveField(
- model_name='productattribute',
- name='name',
- ),
- ]
diff --git a/saleor/product/migrations/0020_auto_20150623_0800.py b/saleor/product/migrations/0020_auto_20150623_0800.py
deleted file mode 100644
index b455e00d60..0000000000
--- a/saleor/product/migrations/0020_auto_20150623_0800.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0019_auto_20150623_0704'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='productattribute',
- name='display',
- field=models.CharField(unique=True, max_length=100),
- ),
- ]
diff --git a/saleor/product/migrations/0021_auto_20150623_0902.py b/saleor/product/migrations/0021_auto_20150623_0902.py
deleted file mode 100644
index b683b88b5a..0000000000
--- a/saleor/product/migrations/0021_auto_20150623_0902.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django.core.validators
-import versatileimagefield.fields
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0020_auto_20150623_0800'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='attributechoicevalue',
- name='color',
- field=models.CharField(blank=True, max_length=6, validators=[django.core.validators.RegexValidator('^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$')]),
- ),
- migrations.AddField(
- model_name='attributechoicevalue',
- name='image',
- field=versatileimagefield.fields.VersatileImageField(null=True, upload_to='attributes', blank=True),
- ),
- ]
diff --git a/saleor/product/migrations/0022_auto_20150623_0913.py b/saleor/product/migrations/0022_auto_20150623_0913.py
deleted file mode 100644
index 6e2462efd6..0000000000
--- a/saleor/product/migrations/0022_auto_20150623_0913.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django.core.validators
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0021_auto_20150623_0902'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='attributechoicevalue',
- name='color',
- field=models.CharField(blank=True, max_length=7, validators=[django.core.validators.RegexValidator('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$')]),
- ),
- ]
diff --git a/saleor/product/migrations/0023_auto_20150624_0741.py b/saleor/product/migrations/0023_auto_20150624_0741.py
deleted file mode 100644
index 4d7090c54c..0000000000
--- a/saleor/product/migrations/0023_auto_20150624_0741.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-def clear_attributes(apps, schema_editor):
- Variant = apps.get_model("product", "ProductVariant")
- for variant in Variant.objects.all():
- variant.attributes = ''
- variant.save()
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0022_auto_20150623_0913'),
- ]
-
- operations = [
- migrations.RunPython(clear_attributes),
- ]
diff --git a/saleor/product/migrations/0024_remove_product_collection.py b/saleor/product/migrations/0024_remove_product_collection.py
deleted file mode 100644
index cc113998f9..0000000000
--- a/saleor/product/migrations/0024_remove_product_collection.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0023_auto_20150624_0741'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='product',
- name='collection',
- ),
- ]
diff --git a/saleor/product/migrations/0025_auto_20150624_0908.py b/saleor/product/migrations/0025_auto_20150624_0908.py
deleted file mode 100644
index 19026a1516..0000000000
--- a/saleor/product/migrations/0025_auto_20150624_0908.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import jsonfield.fields
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0024_remove_product_collection'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='productvariant',
- name='attributes',
- field=jsonfield.fields.JSONField(default={}, verbose_name='attributes', blank=True),
- ),
- ]
diff --git a/saleor/product/migrations/0026_auto_20150624_0921.py b/saleor/product/migrations/0026_auto_20150624_0921.py
deleted file mode 100644
index 0a7ffaa57d..0000000000
--- a/saleor/product/migrations/0026_auto_20150624_0921.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import jsonfield.fields
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0025_auto_20150624_0908'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='productvariant',
- name='attributes',
- field=jsonfield.fields.JSONField(default={}, verbose_name='attributes'),
- ),
- ]
diff --git a/saleor/product/migrations/0027_auto_20150625_0319.py b/saleor/product/migrations/0027_auto_20150625_0319.py
deleted file mode 100644
index 291e5e1201..0000000000
--- a/saleor/product/migrations/0027_auto_20150625_0319.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-def clear_attributes(apps, schema_editor):
- Variant = apps.get_model("product", "ProductVariant")
- for variant in Variant.objects.all():
- variant.attributes = {}
- variant.save()
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0026_auto_20150624_0921'),
- ]
-
- operations = [
- migrations.RunPython(clear_attributes),
- ]
diff --git a/saleor/product/migrations/0028_auto_20150625_0513.py b/saleor/product/migrations/0028_auto_20150625_0513.py
deleted file mode 100644
index 382b758dea..0000000000
--- a/saleor/product/migrations/0028_auto_20150625_0513.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django_prices.models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0027_auto_20150625_0319'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='fixedproductdiscount',
- name='discount',
- field=django_prices.models.PriceField(currency=b'USD', verbose_name='discount value', max_digits=12, decimal_places=2),
- ),
- migrations.AlterField(
- model_name='product',
- name='price',
- field=django_prices.models.PriceField(currency=b'USD', verbose_name='price', max_digits=12, decimal_places=2),
- ),
- migrations.AlterField(
- model_name='productvariant',
- name='name',
- field=models.CharField(max_length=100, verbose_name='variant name', blank=True),
- ),
- migrations.AlterField(
- model_name='productvariant',
- name='price_override',
- field=django_prices.models.PriceField(decimal_places=2, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='price override'),
- ),
- migrations.AlterField(
- model_name='stock',
- name='cost_price',
- field=django_prices.models.PriceField(decimal_places=2, currency=b'USD', max_digits=12, blank=True, null=True, verbose_name='cost price'),
- ),
- ]
diff --git a/saleor/product/migrations/0029_auto_20150625_0802.py b/saleor/product/migrations/0029_auto_20150625_0802.py
deleted file mode 100644
index f0783ffa6d..0000000000
--- a/saleor/product/migrations/0029_auto_20150625_0802.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0028_auto_20150625_0513'),
- ]
-
- operations = [
- migrations.AlterModelOptions(
- name='productattribute',
- options={'ordering': ['slug']},
- ),
- migrations.AddField(
- model_name='productattribute',
- name='slug',
- field=models.SlugField(default=''),
- preserve_default=False,
- ),
- migrations.AlterField(
- model_name='productattribute',
- name='display',
- field=models.CharField(max_length=100),
- ),
- ]
diff --git a/saleor/product/migrations/0030_auto_20150625_0803.py b/saleor/product/migrations/0030_auto_20150625_0803.py
deleted file mode 100644
index f3071af524..0000000000
--- a/saleor/product/migrations/0030_auto_20150625_0803.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-from django.utils.text import slugify
-
-
-def generate_slug(apps, schema_editor):
- ProductAttribute = apps.get_model("product", "ProductAttribute")
- for attr in ProductAttribute.objects.all():
- attr.slug = slugify(attr.display)
- attr.save()
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0029_auto_20150625_0802'),
- ]
-
- operations = [
- migrations.RunPython(generate_slug),
- ]
diff --git a/saleor/product/migrations/0031_auto_20150625_0803.py b/saleor/product/migrations/0031_auto_20150625_0803.py
deleted file mode 100644
index 987ab9bb54..0000000000
--- a/saleor/product/migrations/0031_auto_20150625_0803.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0030_auto_20150625_0803'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='productattribute',
- name='slug',
- field=models.SlugField(unique=True),
- ),
- ]
diff --git a/saleor/product/migrations/0032_auto_20150701_1004.py b/saleor/product/migrations/0032_auto_20150701_1004.py
deleted file mode 100644
index 4969ec78f4..0000000000
--- a/saleor/product/migrations/0032_auto_20150701_1004.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0031_auto_20150625_0803'),
- ]
-
- operations = [
- migrations.AlterModelOptions(
- name='productattribute',
- options={'ordering': ['name']},
- ),
- migrations.RemoveField(
- model_name='productattribute',
- name='slug',
- ),
- migrations.AddField(
- model_name='productattribute',
- name='name',
- field=models.SlugField(default='', verbose_name='name'),
- preserve_default=False,
- ),
- migrations.AlterField(
- model_name='productattribute',
- name='display',
- field=models.CharField(max_length=100, verbose_name='display'),
- ),
- ]
diff --git a/saleor/product/migrations/0033_auto_20150701_1005.py b/saleor/product/migrations/0033_auto_20150701_1005.py
deleted file mode 100644
index 3461e06e7e..0000000000
--- a/saleor/product/migrations/0033_auto_20150701_1005.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import migrations
-from django.utils.text import slugify
-
-
-def generate_name(apps, schema_editor):
- ProductAttribute = apps.get_model("product", "ProductAttribute")
- for attr in ProductAttribute.objects.all():
- attr.name = slugify(attr.display)
- attr.save()
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0032_auto_20150701_1004'),
- ]
-
- operations = [
- migrations.RunPython(generate_name),
- ]
-
diff --git a/saleor/product/migrations/0034_auto_20150706_0643.py b/saleor/product/migrations/0034_auto_20150706_0643.py
deleted file mode 100644
index f34d88115b..0000000000
--- a/saleor/product/migrations/0034_auto_20150706_0643.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0033_auto_20150701_1005'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='category',
- name='hidden',
- field=models.BooleanField(default=False, verbose_name='hidden'),
- ),
- migrations.AlterField(
- model_name='productattribute',
- name='name',
- field=models.SlugField(unique=True, verbose_name='name'),
- ),
- ]
diff --git a/saleor/product/migrations/0035_auto_20150709_0345.py b/saleor/product/migrations/0035_auto_20150709_0345.py
deleted file mode 100644
index cf0dd11710..0000000000
--- a/saleor/product/migrations/0035_auto_20150709_0345.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-import django.utils.timezone
-import saleor.product.models.fields
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0034_auto_20150706_0643'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='product',
- name='available_on',
- field=models.DateField(default=django.utils.timezone.now, verbose_name='available on'),
- ),
- migrations.AlterField(
- model_name='product',
- name='weight',
- field=saleor.product.models.fields.WeightField(unit=b'lb', verbose_name='weight', max_digits=6, decimal_places=2),
- ),
- migrations.AlterField(
- model_name='productvariant',
- name='weight_override',
- field=saleor.product.models.fields.WeightField(decimal_places=2, max_digits=6, blank=True, null=True, verbose_name='weight override', unit=b'lb'),
- ),
- ]
diff --git a/saleor/product/migrations/0036_auto_20150709_0517.py b/saleor/product/migrations/0036_auto_20150709_0517.py
deleted file mode 100644
index fc95380229..0000000000
--- a/saleor/product/migrations/0036_auto_20150709_0517.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0035_auto_20150709_0345'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='product',
- name='available_on',
- field=models.DateField(verbose_name='available on', blank=True),
- ),
- ]
diff --git a/saleor/product/migrations/0037_auto_20150709_0517.py b/saleor/product/migrations/0037_auto_20150709_0517.py
deleted file mode 100644
index d8ce5eff87..0000000000
--- a/saleor/product/migrations/0037_auto_20150709_0517.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0036_auto_20150709_0517'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='product',
- name='available_on',
- field=models.DateField(null=True, verbose_name='available on', blank=True),
- ),
- ]
diff --git a/saleor/product/migrations/0038_auto_20150714_0732.py b/saleor/product/migrations/0038_auto_20150714_0732.py
deleted file mode 100644
index f31cc764cc..0000000000
--- a/saleor/product/migrations/0038_auto_20150714_0732.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('product', '0037_auto_20150709_0517'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='productvariant',
- name='sku',
- field=models.CharField(unique=True, max_length=32, verbose_name='SKU'),
- ),
- ]
diff --git a/saleor/registration/migrations/__init__.py b/saleor/registration/migrations/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/saleor/userprofile/migrations/0001_initial.py b/saleor/userprofile/migrations/0001_initial.py
new file mode 100644
index 0000000000..31c1df14a3
--- /dev/null
+++ b/saleor/userprofile/migrations/0001_initial.py
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+import django.utils.timezone
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('auth', '0006_require_contenttypes_0002'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='User',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
+ ('email', models.EmailField(unique=True, max_length=254)),
+ ('is_staff', models.BooleanField(default=False, verbose_name='staff status')),
+ ('is_active', models.BooleanField(default=False, verbose_name='active')),
+ ('password', models.CharField(verbose_name='password', max_length=128, editable=False)),
+ ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined', editable=False)),
+ ('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login', editable=False)),
+ ],
+ options={
+ 'abstract': False,
+ },
+ ),
+ migrations.CreateModel(
+ name='Address',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('first_name', models.CharField(max_length=256, verbose_name='first name')),
+ ('last_name', models.CharField(max_length=256, verbose_name='last name')),
+ ('company_name', models.CharField(max_length=256, verbose_name='company name', blank=True)),
+ ('street_address_1', models.CharField(max_length=256, verbose_name='street address 1')),
+ ('street_address_2', models.CharField(max_length=256, verbose_name='street address 2', blank=True)),
+ ('city', models.CharField(max_length=256, verbose_name='city')),
+ ('postal_code', models.CharField(max_length=20, verbose_name='postal code')),
+ ('country', models.CharField(max_length=2, verbose_name='country', choices=[('AF', 'Afghanistan'), ('AX', '\xc5land Islands'), ('AL', 'Albania'), ('DZ', 'Algeria'), ('AS', 'American Samoa'), ('AD', 'Andorra'), ('AO', 'Angola'), ('AI', 'Anguilla'), ('AQ', 'Antarctica'), ('AG', 'Antigua And Barbuda'), ('AR', 'Argentina'), ('AM', 'Armenia'), ('AW', 'Aruba'), ('AU', 'Australia'), ('AT', 'Austria'), ('AZ', 'Azerbaijan'), ('BS', 'Bahamas'), ('BH', 'Bahrain'), ('BD', 'Bangladesh'), ('BB', 'Barbados'), ('BY', 'Belarus'), ('BE', 'Belgium'), ('BZ', 'Belize'), ('BJ', 'Benin'), ('BM', 'Bermuda'), ('BT', 'Bhutan'), ('BO', 'Bolivia'), ('BQ', 'Bonaire, Saint Eustatius And Saba'), ('BA', 'Bosnia And Herzegovina'), ('BW', 'Botswana'), ('BV', 'Bouvet Island'), ('BR', 'Brazil'), ('IO', 'British Indian Ocean Territory'), ('BN', 'Brunei Darussalam'), ('BG', 'Bulgaria'), ('BF', 'Burkina Faso'), ('BI', 'Burundi'), ('KH', 'Cambodia'), ('CM', 'Cameroon'), ('CA', 'Canada'), ('CV', 'Cape Verde'), ('KY', 'Cayman Islands'), ('CF', 'Central African Republic'), ('TD', 'Chad'), ('CL', 'Chile'), ('CN', 'China'), ('CX', 'Christmas Island'), ('CC', 'Cocos (Keeling) Islands'), ('CO', 'Colombia'), ('KM', 'Comoros'), ('CG', 'Congo'), ('CD', 'Congo, The Democratic Republic of the'), ('CK', 'Cook Islands'), ('CR', 'Costa Rica'), ('CI', "C\xf4te D'Ivoire"), ('HR', 'Croatia'), ('CU', 'Cuba'), ('CW', 'Cura\xe7o'), ('CY', 'Cyprus'), ('CZ', 'Czech Republic'), ('DK', 'Denmark'), ('DJ', 'Djibouti'), ('DM', 'Dominica'), ('DO', 'Dominican Republic'), ('EC', 'Ecuador'), ('EG', 'Egypt'), ('SV', 'El Salvador'), ('GQ', 'Equatorial Guinea'), ('ER', 'Eritrea'), ('EE', 'Estonia'), ('ET', 'Ethiopia'), ('FK', 'Falkland Islands (Malvinas)'), ('FO', 'Faroe Islands'), ('FJ', 'Fiji'), ('FI', 'Finland'), ('FR', 'France'), ('GF', 'French Guiana'), ('PF', 'French Polynesia'), ('TF', 'French Southern Territories'), ('GA', 'Gabon'), ('GM', 'Gambia'), ('GE', 'Georgia'), ('DE', 'Germany'), ('GH', 'Ghana'), ('GI', 'Gibraltar'), ('GR', 'Greece'), ('GL', 'Greenland'), ('GD', 'Grenada'), ('GP', 'Guadeloupe'), ('GU', 'Guam'), ('GT', 'Guatemala'), ('GG', 'Guernsey'), ('GN', 'Guinea'), ('GW', 'Guinea-Bissau'), ('GY', 'Guyana'), ('HT', 'Haiti'), ('HM', 'Heard Island And Mcdonald Islands'), ('VA', 'Holy See (Vatican City State)'), ('HN', 'Honduras'), ('HK', 'Hong Kong'), ('HU', 'Hungary'), ('IS', 'Iceland'), ('IN', 'India'), ('ID', 'Indonesia'), ('IR', 'Iran, Islamic Republic of'), ('IQ', 'Iraq'), ('IE', 'Ireland'), ('IM', 'Isle of Man'), ('IL', 'Israel'), ('IT', 'Italy'), ('JM', 'Jamaica'), ('JP', 'Japan'), ('JE', 'Jersey'), ('JO', 'Jordan'), ('KZ', 'Kazakhstan'), ('KE', 'Kenya'), ('KI', 'Kiribati'), ('KP', "Korea, Democratic People's Republic of"), ('KR', 'Korea, Republic of'), ('KW', 'Kuwait'), ('KG', 'Kyrgyzstan'), ('LA', "Lao People's Democratic Republic"), ('LV', 'Latvia'), ('LB', 'Lebanon'), ('LS', 'Lesotho'), ('LR', 'Liberia'), ('LY', 'Libya'), ('LI', 'Liechtenstein'), ('LT', 'Lithuania'), ('LU', 'Luxembourg'), ('MO', 'Macao'), ('MK', 'Macedonia, The Former Yugoslav Republic of'), ('MG', 'Madagascar'), ('MW', 'Malawi'), ('MY', 'Malaysia'), ('MV', 'Maldives'), ('ML', 'Mali'), ('MT', 'Malta'), ('MH', 'Marshall Islands'), ('MQ', 'Martinique'), ('MR', 'Mauritania'), ('MU', 'Mauritius'), ('YT', 'Mayotte'), ('MX', 'Mexico'), ('FM', 'Micronesia, Federated States of'), ('MD', 'Moldova, Republic of'), ('MC', 'Monaco'), ('MN', 'Mongolia'), ('ME', 'Montenegro'), ('MS', 'Montserrat'), ('MA', 'Morocco'), ('MZ', 'Mozambique'), ('MM', 'Myanmar'), ('NA', 'Namibia'), ('NR', 'Nauru'), ('NP', 'Nepal'), ('NL', 'Netherlands'), ('NC', 'New Caledonia'), ('NZ', 'New Zealand'), ('NI', 'Nicaragua'), ('NE', 'Niger'), ('NG', 'Nigeria'), ('NU', 'Niue'), ('NF', 'Norfolk Island'), ('MP', 'Northern Mariana Islands'), ('NO', 'Norway'), ('OM', 'Oman'), ('PK', 'Pakistan'), ('PW', 'Palau'), ('PS', 'Palestinian Territory, Occupied'), ('PA', 'Panama'), ('PG', 'Papua New Guinea'), ('PY', 'Paraguay'), ('PE', 'Peru'), ('PH', 'Philippines'), ('PN', 'Pitcairn'), ('PL', 'Poland'), ('PT', 'Portugal'), ('PR', 'Puerto Rico'), ('QA', 'Qatar'), ('RE', 'R\xe9union'), ('RO', 'Romania'), ('RU', 'Russian Federation'), ('RW', 'Rwanda'), ('BL', 'Saint Barth\xe9lemy'), ('SH', 'Saint Helena, Ascension And Tristan Da Cunha'), ('KN', 'Saint Kitts And Nevis'), ('LC', 'Saint Lucia'), ('MF', 'Saint Martin (French Part)'), ('PM', 'Saint Pierre And Miquelon'), ('VC', 'Saint Vincent And the Grenadines'), ('WS', 'Samoa'), ('SM', 'San Marino'), ('ST', 'Sao Tome And Principe'), ('SA', 'Saudi Arabia'), ('SN', 'Senegal'), ('RS', 'Serbia'), ('SC', 'Seychelles'), ('SL', 'Sierra Leone'), ('SG', 'Singapore'), ('SX', 'Sint Maarten (Dutch Part)'), ('SK', 'Slovakia'), ('SI', 'Slovenia'), ('SB', 'Solomon Islands'), ('SO', 'Somalia'), ('ZA', 'South Africa'), ('GS', 'South Georgia and the South Sandwich Islands'), ('ES', 'Spain'), ('LK', 'Sri Lanka'), ('SD', 'Sudan'), ('SR', 'Suriname'), ('SJ', 'Svalbard and Jan Mayen'), ('SZ', 'Swaziland'), ('SE', 'Sweden'), ('CH', 'Switzerland'), ('SY', 'Syria'), ('TW', 'Taiwan'), ('TJ', 'Tajikistan'), ('TZ', 'Tanzania'), ('TH', 'Thailand'), ('TL', 'Timor-Leste'), ('TG', 'Togo'), ('TK', 'Tokelau'), ('TO', 'Tonga'), ('TT', 'Trinidad And Tobago'), ('TN', 'Tunisia'), ('TR', 'Turkey'), ('TM', 'Turkmenistan'), ('TC', 'Turks And Caicos Islands'), ('TV', 'Tuvalu'), ('UG', 'Uganda'), ('UA', 'Ukraine'), ('AE', 'United Arab Emirates'), ('GB', 'United Kingdom'), ('US', 'United States'), ('UM', 'United States Minor Outlying Islands'), ('UY', 'Uruguay'), ('UZ', 'Uzbekistan'), ('VU', 'Vanuatu'), ('VE', 'Venezuela'), ('VN', 'Viet Nam'), ('VG', 'Virgin Islands, British'), ('VI', 'Virgin Islands, U.S.'), ('WF', 'Wallis And Futuna'), ('EH', 'Western Sahara'), ('YE', 'Yemen'), ('ZM', 'Zambia'), ('ZW', 'Zimbabwe')])),
+ ('country_area', models.CharField(max_length=128, verbose_name='country administrative area', blank=True)),
+ ('phone', models.CharField(max_length=30, verbose_name='phone number', blank=True)),
+ ],
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='addresses',
+ field=models.ManyToManyField(to='userprofile.Address'),
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='default_billing_address',
+ field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='default billing address', blank=True, to='userprofile.Address', null=True),
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='default_shipping_address',
+ field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='default shipping address', blank=True, to='userprofile.Address', null=True),
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='groups',
+ field=models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Group', blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', verbose_name='groups'),
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='user_permissions',
+ field=models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Permission', blank=True, help_text='Specific permissions for this user.', verbose_name='user permissions'),
+ ),
+ ]
diff --git a/saleor/userprofile/migrations/__init__.py b/saleor/userprofile/migrations/__init__.py
new file mode 100644
index 0000000000..e69de29bb2