mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add View/Form for creating a new PartParameterTemplate
This commit is contained in:
parent
15a42878db
commit
307a04da58
@ -99,6 +99,17 @@ class EditPartForm(HelperForm):
|
||||
]
|
||||
|
||||
|
||||
class EditPartParameterTemplateForm(HelperForm):
|
||||
""" Form for editing a PartParameterTemplate object """
|
||||
|
||||
class Meta:
|
||||
model = PartParameterTemplate
|
||||
fields = [
|
||||
'name',
|
||||
'units'
|
||||
]
|
||||
|
||||
|
||||
class EditPartParameterForm(HelperForm):
|
||||
""" Form for editing a PartParameter object """
|
||||
|
||||
|
@ -45,7 +45,13 @@
|
||||
|
||||
$('#param-create').click(function() {
|
||||
launchModalForm("{% url 'part-param-create' %}?part={{ part.id }}", {
|
||||
reload: true,
|
||||
reload: true,
|
||||
secondary: [{
|
||||
field: 'template',
|
||||
label: 'New Template',
|
||||
title: 'Create New Parameter Template',
|
||||
url: "{% url 'part-param-template-create' %}"
|
||||
}],
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -19,7 +19,11 @@ part_attachment_urls = [
|
||||
]
|
||||
|
||||
part_parameter_urls = [
|
||||
|
||||
url('^template/new/', views.PartParameterTemplateCreate.as_view(), name='part-param-template-create'),
|
||||
|
||||
url('^new/', views.PartParameterCreate.as_view(), name='part-param-create'),
|
||||
|
||||
]
|
||||
|
||||
part_detail_urls = [
|
||||
|
@ -1397,6 +1397,14 @@ class PartPricing(AjaxView):
|
||||
return self.renderJsonResponse(request, self.form_class(), data=data, context=self.get_pricing(quantity))
|
||||
|
||||
|
||||
class PartParameterTemplateCreate(AjaxCreateView):
|
||||
""" View for creating a new PartParameterTemplate """
|
||||
|
||||
model = PartParameterTemplate
|
||||
form_class = part_forms.EditPartParameterTemplateForm
|
||||
ajax_form_title = 'Create Part Parameter Template'
|
||||
|
||||
|
||||
class PartParameterCreate(AjaxCreateView):
|
||||
""" View for creating a new PartParameter """
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user