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

Pass file data through to the next form page

This commit is contained in:
Oliver Walters
2019-06-27 23:49:01 +10:00
parent a9396f4c74
commit 4648db6ce5
6 changed files with 161 additions and 42 deletions

View File

@@ -39,25 +39,29 @@ class BomValidateForm(HelperForm):
]
class BomImportForm(HelperForm):
class BomUploadSelectFile(HelperForm):
""" Form for importing a BOM. Provides a file input box for upload """
bom_file = forms.FileField(label='BOM file', required=True, help_text="Select BOM file to upload")
starting_row = forms.IntegerField(
required=True,
initial=2,
help_text='First row containing valid BOM data',
validators=[
MinValueValidator(1)
]
)
class Meta:
model = Part
fields = [
'bom_file',
]
class BomUploadSelectFields(HelperForm):
""" Form for selecting BOM fields """
starting_row = forms.IntegerField(required=True, initial=2, help_text='Index of starting row', validators=[MinValueValidator(1)])
row_count = forms.IntegerField(required=True, help_text='Number of rows to process', validators=[MinValueValidator(0)])
class Meta:
model = Part
fields = [
'starting_row',
'row_count',
]