MAI/LabWork01/LoadDB.py

24 lines
752 B
Python

from flask import Flask, redirect, url_for, request, render_template
from LabWork01.FuncLoad import createList
app = Flask(__name__)
@app.route("/")
def home():
return render_template('main_page.html', firstColumn=1, secondColumn=4)
@app.route("/showDiapason", methods=['GET','POST'])
def numtext():
data = request.args
listShops = createList()
if int(data['firstRow']) and int(data['secondRow']) and int(data['firstColumn']) and int(data['secondColumn']):
listShops = listShops[int(data['firstRow']):int(data['secondRow'])+1:1]
return render_template('main_page.html', context=listShops, firstColumn=int(data['firstColumn']), secondColumn=int(data['secondColumn']))
if __name__=="__main__":
app.run(debug=True)