passei os frontends pra bootstrap-flask

This commit is contained in:
LS
2025-02-19 14:27:14 -03:00
parent eff8c531d7
commit 765688df1f
19 changed files with 205 additions and 162 deletions

14
app.py
View File

@@ -18,11 +18,13 @@ from functions.database import (
from sqlalchemy import create_engine, and_
from sqlalchemy.orm import sessionmaker
from datetime import datetime
from flask_bootstrap import Bootstrap5
Session = sessionmaker(bind=engine)
session = Session()
app = Flask(__name__)
bootstrap = Bootstrap5(app)
def session_run(model):
@@ -236,19 +238,11 @@ def listar_relatorios_vendas():
def home():
links = []
for rule in app.url_map.iter_rules():
# Filter out rules we can't navigate to in a browser
# and rules that require parameters
if "GET" in rule.methods and has_no_empty_params(rule):
url = url_for(rule.endpoint, **(rule.defaults or {}))
links.append((url, rule.endpoint))
l_html = ""
for l in links:
l_html += f'<a href="{l[0]}">{l[1].replace("_"," ")}</a><br>'
home_html = f"""
<p>Links</p>
{l_html}
"""
return home_html
return render_template('home.html', links=links)
def has_no_empty_params(rule):