Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Change default attributes value to dict
Marcin Gębala2ed7ee4a4b3c
diff --git a/saleor/product/migrations/0016_auto_20161204_0311.py b/saleor/product/migrations/0016_auto_20161204_0311.pynew file mode 100644index 0000000000..ced0fd17c8--- /dev/null+++ b/saleor/product/migrations/0016_auto_20161204_0311.py@@ -0,0 +1,21 @@+# -*- coding: utf-8 -*-+# Generated by Django 1.10.3 on 2016-12-04 09:11+from __future__ import unicode_literals++import django.contrib.postgres.fields.hstore+from django.db import migrations+++class Migration(migrations.Migration):++ dependencies = [+ ('product', '0015_productvariant_attributes'),+ ]++ operations = [+ migrations.AlterField(+ model_name='productvariant',+ name='attributes',+ field=django.contrib.postgres.fields.hstore.HStoreField(default={}, verbose_name='attributes'),+ ),+ ]diff --git a/saleor/product/models/base.py b/saleor/product/models/base.pyindex bbf3e36bf8..901250f31e 100644--- a/saleor/product/models/base.py+++ b/saleor/product/models/base.py@@ -13,12 +13,10 @@ from django.utils.encoding import python_2_unicode_compatible, smart_textfrom django.utils.text import slugifyfrom django.utils.translation import pgettext_lazyfrom django_prices.models import PriceField-from django.contrib.postgres.fields import HStoreFieldfrom mptt.managers import TreeManagerfrom mptt.models import MPTTModelfrom satchless.item import InsufficientStock, Item, ItemRangefrom unidecode import unidecode-from versatileimagefield.fields import VersatileImageFieldfrom ...discount.models import get_variant_discountsfrom .fields import WeightField@@ -204,7 +202,7 @@ class ProductVariant(models.Model, Item):blank=True, null=True)product = models.ForeignKey(Product, related_name='variants')attributes = HStoreField(- pgettext_lazy('Variant field', 'attributes'), default='')+ pgettext_lazy('Variant field', 'attributes'), default={})images = models.ManyToManyField('ProductImage', through='VariantImage')class Meta: