James McCool commited on
Commit
14840d6
·
1 Parent(s): b44c733

Add button for loading projections from database in Data Load tab

Browse files

Updated the projections file loading logic to include a button for users to load projections directly from the Paydirt DB. This change enhances user interaction by providing a clear action for database loading, while maintaining the existing user upload functionality.

Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -663,8 +663,9 @@ if selected_tab == 'Data Load':
663
  if proj_options == 'User Upload':
664
  projections_file = st.file_uploader("Upload Projections File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
665
  elif proj_options == 'Paydirt DB':
666
- projections_file = init_nfl_baselines(type_var, site_var, 'Main Slate')
667
- st.session_state['db_projections_file'] = projections_file
 
668
  if 'projections_df' in st.session_state:
669
  del st.session_state['projections_df']
670
 
 
663
  if proj_options == 'User Upload':
664
  projections_file = st.file_uploader("Upload Projections File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
665
  elif proj_options == 'Paydirt DB':
666
+ if st.button("Load from Database"):
667
+ projections_file = init_nfl_baselines(type_var, site_var, 'Main Slate')
668
+ st.session_state['db_projections_file'] = projections_file
669
  if 'projections_df' in st.session_state:
670
  del st.session_state['projections_df']
671