Maik Hoepfel
3e4c2f73dd
Allow unassigning categories from products
This has been impossible so far. It is easily achieved by setting
can_delete=True on the formset.
I spent some time trying to get the nice solution working, which would
be that assigning an empty category means deleting that ProductCategory
instance. But I haven't found a good solution that avoids problems like
in #1267. I have since come to the conclusion that enabling can_delete
is the right thing to do. One can then explicitly hide the checkbox,
but set the correct hidden field in Javascript on the client side if
an empty value is assigned.
The fields section has been moved from the factory declaration to the
ProductForm Meta class to allow for easier customisation.
Fixes #1289