refactor: Update query result handling and deprecated Streamlit function
This commit is contained in:
parent
7fe83a0f6a
commit
26238a6afb
@ -244,7 +244,7 @@ def trading_journal_page():
|
||||
|
||||
add_trade(trade)
|
||||
st.success("Trade added successfully!")
|
||||
st.experimental_set_query_params(rerun=True)
|
||||
st.query_params(rerun=True)
|
||||
except Exception as e:
|
||||
st.error(f"Error adding trade: {str(e)}")
|
||||
|
||||
@ -310,7 +310,7 @@ def trading_journal_page():
|
||||
|
||||
update_trade(trade_id, updates)
|
||||
st.success("Trade updated successfully!")
|
||||
st.experimental_set_query_params(rerun=True)
|
||||
st.query_params(rerun=True)
|
||||
except Exception as e:
|
||||
st.error(f"Error updating trade: {str(e)}")
|
||||
else:
|
||||
|
||||
@ -267,7 +267,8 @@ def get_all_trading_plans(status: Optional[PlanStatus] = None) -> List[TradingPl
|
||||
query += " ORDER BY updated_at DESC"
|
||||
|
||||
results = client.query(query, params)
|
||||
return [get_trading_plan(result[0]) for result in results]
|
||||
rows = results.result_rows
|
||||
return [get_trading_plan(row[0]) for row in rows]
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error retrieving trading plans: {e}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user