Отдельная страница для вывода результатов

This commit is contained in:
Anton Kamalov
2024-10-23 23:11:01 +03:00
parent ac7541ce29
commit a7ee179dc4
3 changed files with 29 additions and 28 deletions

View File

@@ -25,14 +25,14 @@ def sklad_zapros():
if request.method == 'GET':
zagotovki = route(session['db_config'], {}, sql_provider, 'zagotovki.sql')
if zagotovki.status:
return render_template('sklad_zapros.html', materials=zagotovki.result, status=True)
return render_template('sklad_zapros.html', materials=zagotovki.result)
else:
return zagotovki.error_message
else:
material = dict(request.form)
zagotovki = route(session['db_config'], material, sql_provider, 'zapros1.sql')
if zagotovki.status:
print(zagotovki.result)
return render_template('sklad_zapros.html', items=zagotovki.result)
categories = ['Материал', 'Вес', 'Цена', 'Количество']
return render_template('output.html', items=zagotovki.result, categories = categories)
else:
return zagotovki.error_message