mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-04 06:18:48 +00:00
docstring improvements
This commit is contained in:
parent
bc12af5994
commit
87411293cf
@ -92,12 +92,15 @@ class PartCreate(AjaxCreateView):
|
|||||||
return context
|
return context
|
||||||
|
|
||||||
def get_form(self):
|
def get_form(self):
|
||||||
|
""" Create Form for making new Part object.
|
||||||
|
Remove the 'default_supplier' field as there are not yet any matching SupplierPart objects
|
||||||
|
"""
|
||||||
form = super(AjaxCreateView, self).get_form()
|
form = super(AjaxCreateView, self).get_form()
|
||||||
|
|
||||||
# Hide the default_supplier field (there are no matching supplier parts yet!)
|
# Hide the default_supplier field (there are no matching supplier parts yet!)
|
||||||
#form.fields['default_supplier'].widget.attrs['hidden'] = True
|
#form.fields['default_supplier'].widget.attrs['hidden'] = True
|
||||||
del form.fields['default_supplier']
|
del form.fields['default_supplier']
|
||||||
|
|
||||||
return form
|
return form
|
||||||
|
|
||||||
# Pre-fill the category field if a valid category is provided
|
# Pre-fill the category field if a valid category is provided
|
||||||
@ -449,6 +452,9 @@ class SupplierPartCreate(AjaxCreateView):
|
|||||||
context_object_name = 'part'
|
context_object_name = 'part'
|
||||||
|
|
||||||
def get_form(self):
|
def get_form(self):
|
||||||
|
""" Create Form instance to create a new SupplierPart object.
|
||||||
|
Hide some fields if they are not appropriate in context
|
||||||
|
"""
|
||||||
form = super(AjaxCreateView, self).get_form()
|
form = super(AjaxCreateView, self).get_form()
|
||||||
|
|
||||||
if form.initial.get('supplier', None):
|
if form.initial.get('supplier', None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user