diff --git a/registrasion/admin.py b/registrasion/admin.py index e00b58ea..17969cd1 100644 --- a/registrasion/admin.py +++ b/registrasion/admin.py @@ -80,3 +80,15 @@ class VoucherAdmin(nested_admin.NestedAdmin): VoucherDiscountInline, VoucherEnablingConditionInline, ] + + +# Enabling conditions +@admin.register(rego.ProductEnablingCondition) +class ProductEnablingConditionAdmin(nested_admin.NestedAdmin): + model = rego.ProductEnablingCondition + + +# Enabling conditions +@admin.register(rego.CategoryEnablingCondition) +class CategoryEnablingConditionAdmin(nested_admin.NestedAdmin): + model = rego.CategoryEnablingCondition diff --git a/registrasion/migrations/0001_initial.py b/registrasion/migrations/0001_squashed_0002_auto_20160304_1723.py similarity index 99% rename from registrasion/migrations/0001_initial.py rename to registrasion/migrations/0001_squashed_0002_auto_20160304_1723.py index ab78d1f0..cc1e3f0d 100644 --- a/registrasion/migrations/0001_initial.py +++ b/registrasion/migrations/0001_squashed_0002_auto_20160304_1723.py @@ -9,6 +9,8 @@ from django.conf import settings class Migration(migrations.Migration): + replaces = [('registrasion', '0001_initial'), ('registrasion', '0002_auto_20160304_1723')] + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] @@ -225,12 +227,12 @@ class Migration(migrations.Migration): migrations.AddField( model_name='enablingconditionbase', name='categories', - field=models.ManyToManyField(to=b'registrasion.Category'), + field=models.ManyToManyField(to=b'registrasion.Category', blank=True), ), migrations.AddField( model_name='enablingconditionbase', name='products', - field=models.ManyToManyField(to=b'registrasion.Product'), + field=models.ManyToManyField(to=b'registrasion.Product', blank=True), ), migrations.AddField( model_name='discountitem', diff --git a/registrasion/models.py b/registrasion/models.py index 26e6b6b6..c84a6abf 100644 --- a/registrasion/models.py +++ b/registrasion/models.py @@ -257,8 +257,8 @@ class EnablingConditionBase(models.Model): description = models.CharField(max_length=255) mandatory = models.BooleanField(default=False) - products = models.ManyToManyField(Product) - categories = models.ManyToManyField(Category) + products = models.ManyToManyField(Product, blank=True) + categories = models.ManyToManyField(Category, blank=True) class TimeOrStockLimitEnablingCondition(EnablingConditionBase):