From 970bb54633bd97c8cbe33f4fa5157c65677acff2 Mon Sep 17 00:00:00 2001 From: Gughanathan M Date: Sun, 3 Nov 2024 16:15:54 +0530 Subject: [PATCH] refactor: enhance _get_list_widget and _list methods to accept additional keyword arguments --- flask_appbuilder/baseviews.py | 6 ++++-- flask_appbuilder/views.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/flask_appbuilder/baseviews.py b/flask_appbuilder/baseviews.py index ad1dc73795..b273f2d14e 100644 --- a/flask_appbuilder/baseviews.py +++ b/flask_appbuilder/baseviews.py @@ -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 {} @@ -1100,6 +1100,7 @@ def _get_list_widget( actions=actions, filters=filters, modelview_name=self.__class__.__name__, + **kwargs, ) return widgets @@ -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 @@ -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() diff --git a/flask_appbuilder/views.py b/flask_appbuilder/views.py index 3c2ba0aff4..67cdf109fd 100644 --- a/flask_appbuilder/views.py +++ b/flask_appbuilder/views.py @@ -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