James McCool
commited on
Commit
·
737b2a7
1
Parent(s):
43df572
Implement form submission for small field preset in app.py: add a submit button to apply lineup target changes, enhancing user interaction and ensuring updates to the working frame are only processed upon user confirmation.
Browse files
app.py
CHANGED
|
@@ -1104,9 +1104,11 @@ with tab2:
|
|
| 1104 |
with st.expander('Presets'):
|
| 1105 |
with st.form(key='Small Field Preset'):
|
| 1106 |
lineup_target = st.number_input("Lineup Target", value=150, min_value=1, step=1)
|
| 1107 |
-
|
| 1108 |
-
|
| 1109 |
-
|
|
|
|
|
|
|
| 1110 |
|
| 1111 |
with col2:
|
| 1112 |
if 'export_base' not in st.session_state:
|
|
|
|
| 1104 |
with st.expander('Presets'):
|
| 1105 |
with st.form(key='Small Field Preset'):
|
| 1106 |
lineup_target = st.number_input("Lineup Target", value=150, min_value=1, step=1)
|
| 1107 |
+
submitted = st.form_submit_button("Submit")
|
| 1108 |
+
if submitted:
|
| 1109 |
+
parsed_frame = small_field_preset(st.session_state['working_frame'], lineup_target)
|
| 1110 |
+
st.session_state['working_frame'] = parsed_frame.sort_values(by='Own', ascending=False)
|
| 1111 |
+
st.session_state['export_merge'] = st.session_state['working_frame'].copy()
|
| 1112 |
|
| 1113 |
with col2:
|
| 1114 |
if 'export_base' not in st.session_state:
|