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:
@@ -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'
|
||||
]
|
Reference in New Issue
Block a user