2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

Started implementation of multi-step form for purchase order file uplod

This commit is contained in:
eeintech
2021-05-03 17:30:33 -04:00
parent 5d214fc869
commit b847604f15
8 changed files with 99 additions and 0 deletions

View File

@ -5,6 +5,8 @@ Django forms for interacting with common objects
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from InvenTree.forms import HelperForm
from .models import InvenTreeSetting
@ -21,3 +23,18 @@ class SettingEditForm(HelperForm):
fields = [
'value'
]
class UploadFile(forms.Form):
''' Step 1 '''
first_name = forms.CharField(max_length=100)
class MatchField(forms.Form):
''' Step 2 '''
last_name = forms.CharField(max_length=100)
class MatchPart(forms.Form):
''' Step 3 '''
age = forms.IntegerField()

View File

@ -8,6 +8,8 @@ from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.forms import CheckboxInput, Select
from formtools.wizard.views import SessionWizardView
from InvenTree.views import AjaxUpdateView
from InvenTree.helpers import str2bool
@ -101,3 +103,12 @@ class SettingEdit(AjaxUpdateView):
if not str2bool(value, test=True) and not str2bool(value, test=False):
form.add_error('value', _('Supplied value must be a boolean'))
class FileUploadWizardView(SessionWizardView):
# file_storage = FileSystemStorage(location=os.path.join(settings.MEDIA_ROOT, 'file_uploads'))
form_list = [
forms.UploadFile,
forms.MatchField,
forms.MatchPart,
]