You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all! I have redefined one of the form fields as a SelectField with a set of values (I want to limit the user to the available options).
Everything works fine, but there is a problem: when you go to edit an existing record, the value that this field had from the database disappears. It becomes either the first one in the list or empty if I use allow_blank=True.
Question: how can I fill this field by default with the value that was previously saved (in this case the field has a valid value - earlier I also selected it from the list)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all! I have redefined one of the form fields as a SelectField with a set of values (I want to limit the user to the available options).
Everything works fine, but there is a problem: when you go to edit an existing record, the value that this field had from the database disappears. It becomes either the first one in the list or empty if I use allow_blank=True.
Question: how can I fill this field by default with the value that was previously saved (in this case the field has a valid value - earlier I also selected it from the list)?
Beta Was this translation helpful? Give feedback.
All reactions