File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,9 +53,15 @@ def create_editable_list_form(
5353 widget = HTMXEditableWidget ()
5454
5555 class ListForm (BaseListForm , form_base_class ): # type: ignore[misc, valid-type]
56- # Stores the original flask-admin widgets (DatePickerWidget, etc.)
57- # before they get replaced with the display widget (HTMXEditableWidget).
58- # Used by ajax_edit/ajax_update to restore proper input widgets.
56+ """
57+ Stores the original flask-admin widgets (DatePickerWidget, etc.)
58+ before they get replaced with the display widget (HTMXEditableWidget).
59+ Used by ajax_edit/ajax_update to restore proper input widgets.
60+ _original_widgets dict must be per-invocation, so do not move the class def
61+ outside of the function unless making the dict instance-level instead of
62+ class-level.
63+ """
64+
5965 _original_widgets : dict [str , t .Any ] = {}
6066
6167 # iterate FormMeta to get unbound fields, replace widget, copy to ListForm
You can’t perform that action at this time.
0 commit comments