|
|
@@ -387,16 +387,18 @@ class ProductCategoryForm(forms.ModelForm):
|
|
387
|
387
|
|
|
388
|
388
|
class Meta:
|
|
389
|
389
|
model = ProductCategory
|
|
|
390
|
+ fields = ('category', )
|
|
390
|
391
|
|
|
391
|
392
|
|
|
392
|
393
|
BaseProductCategoryFormSet = inlineformset_factory(
|
|
393
|
|
- Product, ProductCategory, form=ProductCategoryForm,
|
|
394
|
|
- fields=('category',), extra=1, can_delete=False)
|
|
|
394
|
+ Product, ProductCategory, form=ProductCategoryForm, extra=1,
|
|
|
395
|
+ can_delete=True)
|
|
395
|
396
|
|
|
396
|
397
|
|
|
397
|
398
|
class ProductCategoryFormSet(BaseProductCategoryFormSet):
|
|
398
|
399
|
|
|
399
|
400
|
def __init__(self, product_class, user, *args, **kwargs):
|
|
|
401
|
+ # This function just exists to drop the extra arguments
|
|
400
|
402
|
super(ProductCategoryFormSet, self).__init__(*args, **kwargs)
|
|
401
|
403
|
|
|
402
|
404
|
def clean(self):
|
|
|
@@ -419,6 +421,7 @@ class ProductCategoryFormSet(BaseProductCategoryFormSet):
|
|
419
|
421
|
|
|
420
|
422
|
|
|
421
|
423
|
class ProductImageForm(forms.ModelForm):
|
|
|
424
|
+
|
|
422
|
425
|
class Meta:
|
|
423
|
426
|
model = ProductImage
|
|
424
|
427
|
exclude = ('display_order',)
|