Основы блюпринта для отчетов

This commit is contained in:
2024-11-05 22:46:14 +03:00
parent b9a07fe533
commit ee403adc0a
4 changed files with 64 additions and 0 deletions

21
App/Report/__init__.py Normal file
View File

@@ -0,0 +1,21 @@
from flask import request, Blueprint, render_template
from ..checker import check_auth
from os import path
import json
with open(path.join(path.dirname(__file__), 'zapros_menu.json')) as f:
report_list = json.load(f)
report_bp = Blueprint('report_bp', __name__, template_folder='templates')
@report_bp.route('/', methods=['GET', 'POST'])
@check_auth
def menu():
if request.method == 'GET':
return render_template('report_menu.html', options=report_list)
@report_bp.route('/quarterly', methods=['GET', 'POST'])
@check_auth
def quarterly():
if request.method == 'GET':
return render_template('quarterly.html')