Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: enhance _get_list_widget and _list methods to accept additional kwargs #2285

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading