Beispiel #1
0
def submit():  #delete everything in uploads folder
    if (os.path.exists(uploadFile)):
        os.remove(uploadFile)
    form = SubmitForm()
    if form.is_submitted():
        fileContent = form.inputFile.data
        fileName = fileContent.filename
        fileContent.save(
            uploadFile
        )  #delete contents of upload file somehow, prob at beginning of this function
        return redirect(url_for('display'))
    return render_template('submit.html', form=form)
Beispiel #2
0
def home():

    form = SubmitForm()

    hundred = ''
    ten = ''
    effects = ''

    if form.is_submitted():

        response = requests.post('http://flask-data:5003/data')
        effects = response.json()['result']

    return render_template('home.html',
                           form=form,
                           hundred=hundred,
                           ten=ten,
                           effects=effects)
Beispiel #3
0
def S2ward():
	id = request.values.get('id')
	print id
	form = SubmitForm()

	if form.is_submitted():
		user = User()
		user.info['name'] = request.form.get('name',type=str,default=None)
		user.info['tel'] = request.form.get('tel',type=str,default=None)
		user.info['oidname'] = request.form.get('oidname',type=str,default=None)
		user.info['add'] = request.form.get('add',type=str,default=None)
		print user.info
		return render_template('/result.html')
	#user = User()
	#user.info['name'] = request.form.get('name',type=str,default=None)
	#user.info['tel'] = request.form.get('tel',type=str,default=None)
	#user.oidname = form.oidname.date
	#user.add = form.add.date
	flash('thaks')
	return render_template('S2ward.html',form=form)