Creating a simple front end with Flask where I can select multiple files and runs some calculations on them.
Currently I am using the code below, but it is only good for 1 file, #do something
is where the conversion happens;
class Sources(SimpleFormView):
form = MyForm
form_title = 'This is my first form view'
message = 'My form submitted'
def form_get(self, form):
form.field1.data = 'This was prefilled'
def form_post(self, form):
x = #do something
return self.render_template('test.html', table = x ,name='TEST')
The form basically lets me type in the path as shown below:
from wtforms import Form, StringField
from wtforms.validators import DataRequired
from flask.ext.appbuilder.fieldwidgets import BS3TextFieldWidget
from flask.ext.appbuilder.forms import DynamicForm
class MyForm(DynamicForm):
Path = StringField(('Field1'),
description=('Your field number one!'),
validators = [DataRequired()], widget=BS3TextFieldWidget())
I am trying to select multiple files from my local machine and then process them together. Much like how we attach files using Gmail;
- Option to select file path
- Open file browser
- Store file path
- Process 1 and 3 repeats till hit threshold or submitted.
I am currently using Flask App Builder to get my front end right.