From 1a72846e31c47f75760161f7316dba77abc115b8 Mon Sep 17 00:00:00 2001 From: Razvan Date: Thu, 29 Feb 2024 17:27:46 +0200 Subject: [PATCH 1/3] add rids parameter used to get only the rids of documents --- plone/app/querystring/querybuilder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plone/app/querystring/querybuilder.py b/plone/app/querystring/querybuilder.py index bd8978f..027c33d 100644 --- a/plone/app/querystring/querybuilder.py +++ b/plone/app/querystring/querybuilder.py @@ -97,6 +97,7 @@ def __call__( limit=0, brains=False, custom_query=None, + rids=False, ): """Create a zope catalog query and return results. @@ -145,6 +146,7 @@ def __call__( limit=limit, brains=brains, custom_query=custom_query, + rids=rids, ) return self._results @@ -174,6 +176,7 @@ def _makequery( limit=0, brains=False, custom_query=None, + rids=False, ): """Parse the (form)query and return using multi-adapter""" query_modifiers = getUtilitiesFor(IQueryModifier) @@ -206,6 +209,8 @@ def _makequery( parsedquery = {} empty_query = not parsedquery # store emptiness + + parsedquery["rids"] = rids if batch: parsedquery["b_start"] = b_start From f15ffa386891fb97ad3757eccc752016aa5028bf Mon Sep 17 00:00:00 2001 From: Razvan Date: Thu, 29 Feb 2024 17:45:09 +0200 Subject: [PATCH 2/3] add changelog entry --- news/145.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/145.feature diff --git a/news/145.feature b/news/145.feature new file mode 100644 index 0000000..b33854d --- /dev/null +++ b/news/145.feature @@ -0,0 +1 @@ +add rids parameter in querybuilder used to get only the rids of documents [razvanMiu] (#145) \ No newline at end of file From a4ffeb291e594944fd2a7bb7874bbeb2138ca0a0 Mon Sep 17 00:00:00 2001 From: Razvan Date: Thu, 29 Feb 2024 17:54:24 +0200 Subject: [PATCH 3/3] run black --- plone/app/querystring/querybuilder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plone/app/querystring/querybuilder.py b/plone/app/querystring/querybuilder.py index 027c33d..8e23326 100644 --- a/plone/app/querystring/querybuilder.py +++ b/plone/app/querystring/querybuilder.py @@ -209,7 +209,7 @@ def _makequery( parsedquery = {} empty_query = not parsedquery # store emptiness - + parsedquery["rids"] = rids if batch: