File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {% with messages = get_flashed_messages() %}
2+ {% if messages %}
3+ {% for msg in messages %}
4+ < div class ="alert alert-warning "> {{ msg }}</ div >
5+ {% endfor %}
6+ {% endif %}
7+ {% endwith %}
8+
19{% if results %}
210< table class ="table table-striped table-bordered mt-3 ">
311 < thead >
1725 {% endfor %}
1826 </ tbody >
1927</ table >
20- {% else %}
21- < p class ="text-muted "> Nessun risultato</ p >
2228{% endif %}
Original file line number Diff line number Diff line change @@ -37,10 +37,12 @@ def run_query():
3737 try :
3838 fetched = execute_query (query )
3939 if fetched :
40- columns = [desc [ 0 ] for desc in fetched [ 0 ]. _fields ] if hasattr ( fetched [ 0 ], "_fields" ) else [ f"Col{ i } " for i in range (len (fetched [0 ]))]
40+ columns = [f"Col{ i } " for i in range (len (fetched [0 ]))]
4141 results = fetched
42+ else :
43+ flash ("⚠️ Nessun risultato trovato" )
4244 except Exception as e :
43- return f"<div class='alert alert-danger'> ❌ Errore: { e } </div>"
45+ flash ( f" ❌ Errore: { e } " )
4446
45- # Ritorniamo solo il frammento HTML della tabella
47+ # renderizzi il frammento dei risultati
4648 return render_template ("fragments/query_results.html" , results = results , columns = columns )
You can’t perform that action at this time.
0 commit comments