2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-08 12:50:55 +00:00

Added pages for editing categories

- category-detail
- category-delete
- category-edit
- category-new
This commit is contained in:
Oliver
2018-04-15 11:40:03 +10:00
parent 5b5b8f4d12
commit 17b9f4ec8c
11 changed files with 249 additions and 35 deletions

View File

@@ -2,7 +2,7 @@ from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from .models import Part
from .models import Part, PartCategory
class EditPartForm(forms.ModelForm):
@@ -28,4 +28,26 @@ class EditPartForm(forms.ModelForm):
'URL',
'minimum_stock',
'trackable',
]
class EditCategoryForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(EditCategoryForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_id = 'id-edit-part-form'
self.helper.form_class = 'blueForms'
self.helper.form_method = 'post'
#self.helper.form_action = 'submit'
self.helper.add_input(Submit('submit', 'Submit'))
class Meta:
model = PartCategory
fields = [
'parent',
'name',
'description'
]