Skip to content

Commit 5aa6e8c

Browse files
committed
expand docstring
1 parent a40d63f commit 5aa6e8c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

flask_admin/model/form.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)