From b6561839adde0aca737087661f84afeae85434e7 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Wed, 30 Oct 2024 01:41:27 +0100 Subject: [PATCH] Add `DJANGOCMS_LINK_PAGINATE_BY` setting --- README.rst | 10 ++++++++++ djangocms_link/admin.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index cb5065cf..f84e16c0 100644 --- a/README.rst +++ b/README.rst @@ -145,6 +145,16 @@ smaller the average result set size. The default is 0:: # Require at least 2 characters to be typed before searching for pages DJANGOCMS_LINK_MINIMUM_INPUT_LENGTH = 2 +By default django CMS Link will paginate the search results. You can change the +page size by setting the ``DJANGOCMS_LINK_PAGINATE_BY`` setting. +The default is 100:: + + # Show 5 results per page + DJANGOCMS_LINK_PAGINATE_BY = 100 + +Note, that in the admin paginated search results repeat the modle verbose name. + + Non-standard hostnames ...................... diff --git a/djangocms_link/admin.py b/djangocms_link/admin.py index ce4e22a1..7504d732 100644 --- a/djangocms_link/admin.py +++ b/djangocms_link/admin.py @@ -31,7 +31,7 @@ class GrouperModelAdmin: class AdminUrlsView(BaseListView): """Handle AutocompleteWidget's AJAX requests for data.""" - paginate_by = 20 + paginate_by = getattr(settings, "DJANGOCMS_LINK_PAGINATE_BY", 100) admin_site = None def get(self, request, *args, **kwargs):