|
|
@@ -24,12 +24,22 @@ ProductSelect = get_class('dashboard.catalogue.widgets', 'ProductSelect')
|
|
24
|
24
|
('RelatedFieldWidgetWrapper',
|
|
25
|
25
|
'RelatedMultipleFieldWidgetWrapper'))
|
|
26
|
26
|
|
|
27
|
|
-CategoryForm = movenodeform_factory(
|
|
|
27
|
+
|
|
|
28
|
+BaseCategoryForm = movenodeform_factory(
|
|
28
|
29
|
Category,
|
|
29
|
|
- fields=['name', 'description', 'image', 'is_public'],
|
|
|
30
|
+ fields=['name', 'slug', 'description', 'image', 'is_public'],
|
|
30
|
31
|
exclude=['ancestors_are_public'])
|
|
31
|
32
|
|
|
32
|
33
|
|
|
|
34
|
+class CategoryForm(BaseCategoryForm):
|
|
|
35
|
+
|
|
|
36
|
+ def __init__(self, *args, **kwargs):
|
|
|
37
|
+ super().__init__(*args, **kwargs)
|
|
|
38
|
+ if 'slug' in self.fields:
|
|
|
39
|
+ self.fields['slug'].required = False
|
|
|
40
|
+ self.fields['slug'].help_text = _('Leave blank to generate from category name')
|
|
|
41
|
+
|
|
|
42
|
+
|
|
33
|
43
|
class ProductClassSelectForm(forms.Form):
|
|
34
|
44
|
"""
|
|
35
|
45
|
Form which is used before creating a product to select it's product class
|