Skip to content

Commit

Permalink
refactor: enhance _get_list_widget and _list methods to accept additi…
Browse files Browse the repository at this point in the history
…onal keyword arguments
  • Loading branch information
gugupy committed Nov 3, 2024
1 parent fab9013 commit 970bb54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions flask_appbuilder/baseviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ def _get_list_widget(
page=None,
page_size=None,
widgets=None,
**args,
**kwargs,
):
"""get joined base filter and current active filter for query"""
widgets = widgets or {}
Expand Down Expand Up @@ -1100,6 +1100,7 @@ def _get_list_widget(
actions=actions,
filters=filters,
modelview_name=self.__class__.__name__,
**kwargs,
)
return widgets

Expand Down Expand Up @@ -1162,7 +1163,7 @@ def get_init_inner_views(self):
-----------------------------------------------------
"""

def _list(self):
def _list(self, **kwargs):
"""
list function logic, override to implement different logic
returns list and search widget
Expand All @@ -1182,6 +1183,7 @@ def _list(self):
order_direction=order_direction,
page=page,
page_size=page_size,
**kwargs,
)
form = self.search_form.refresh()
self.update_redirect()
Expand Down
4 changes: 2 additions & 2 deletions flask_appbuilder/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,9 +831,9 @@ def del_key(cls, k):
k = cls.__name__ + "__" + k
session.pop(k)

def _get_list_widget(self, **args):
def _get_list_widget(self, **kwargs):
"""get joined base filter and current active filter for query"""
widgets = super(CompactCRUDMixin, self)._get_list_widget(**args)
widgets = super(CompactCRUDMixin, self)._get_list_widget(**kwargs)
session_form_widget = self.get_key("session_form_widget", None)

form_widget = None
Expand Down

0 comments on commit 970bb54

Please sign in to comment.