remove duplicate field definitions
This commit is contained in:
parent
47e75198fb
commit
3d77f12999
|
@ -19,15 +19,13 @@ class CustomerForm(forms.ModelForm):
|
|||
def __init__(self, *args, **kwargs):
|
||||
super(CustomerForm, self).__init__(*args, **kwargs)
|
||||
|
||||
self.helper = FormHelper()
|
||||
self.helper = FormHelper(self)
|
||||
self.helper.attrs = {
|
||||
'hx-post': reverse_lazy('customer_create'),
|
||||
'id': 'customer-form',
|
||||
}
|
||||
self.helper.layout = Layout(
|
||||
self.helper.layout.append(
|
||||
FormActions(
|
||||
Field('name'),
|
||||
Field('description'),
|
||||
Submit('save', 'Save'),
|
||||
Button('cancel', 'Cancel', css_class="btn btn-secondary",
|
||||
onclick="closeModal()")
|
||||
|
|
|
@ -27,13 +27,12 @@ class DeviceCategoryForm(forms.ModelForm):
|
|||
def __init__(self, *args, **kwargs):
|
||||
super(DeviceCategoryForm, self).__init__(*args, **kwargs)
|
||||
|
||||
self.helper = FormHelper()
|
||||
self.helper = FormHelper(self)
|
||||
self.helper.attrs = {
|
||||
'hx-post': reverse_lazy('device_category_create'),
|
||||
'id': 'device-category-form',
|
||||
}
|
||||
self.helper.layout = Layout(
|
||||
Field('name'),
|
||||
self.helper.layout.append(
|
||||
FormActions(
|
||||
Submit('save_category', 'Save'),
|
||||
Button('cancel', 'Cancel', css_class="btn btn-secondary",
|
||||
|
|
Loading…
Reference in New Issue