Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add categories to discount model
Artur Smętfe9c564bca8f
diff --git a/saleor/product/migrations/0009_discount_categories.py b/saleor/product/migrations/0009_discount_categories.pynew file mode 100644index 0000000000..a415702726--- /dev/null+++ b/saleor/product/migrations/0009_discount_categories.py@@ -0,0 +1,20 @@+# -*- coding: utf-8 -*-+# Generated by Django 1.9.1 on 2016-01-14 14:29+from __future__ import unicode_literals++from django.db import migrations, models+++class Migration(migrations.Migration):++ dependencies = [+ ('product', '0008_auto_20160114_0733'),+ ]++ operations = [+ migrations.AddField(+ model_name='discount',+ name='categories',+ field=models.ManyToManyField(blank=True, to='product.Category'),+ ),+ ]diff --git a/saleor/product/models/discounts.py b/saleor/product/models/discounts.pyindex 46b3954eb6..f5285c562e 100644--- a/saleor/product/models/discounts.py+++ b/saleor/product/models/discounts.py@@ -23,8 +23,9 @@ class Discount(models.Model):name = models.CharField(max_length=255)type = models.CharField(max_length=10, choices=DISCOUNT_TYPE_CHOICES,default=FIXED)- products = models.ManyToManyField('Product', blank=True)value = models.DecimalField(max_digits=12, decimal_places=2, default=0)+ products = models.ManyToManyField('Product', blank=True)+ categories = models.ManyToManyField('Category', blank=True)class Meta:app_label = 'product'