From 56e72c737358d3fb0521c29743d45c52451f8a7d Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 25 Jul 2008 14:15:05 +0000
Subject: [PATCH] Accept and transmit a "limit" parameter to sql query.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22664 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFCategory/CategoryTool.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/product/CMFCategory/CategoryTool.py b/product/CMFCategory/CategoryTool.py
index 0e0d173b59..8346358412 100644
--- a/product/CMFCategory/CategoryTool.py
+++ b/product/CMFCategory/CategoryTool.py
@@ -1375,10 +1375,15 @@ class CategoryTool( UniqueObject, Folder, Base ):
         for base_category in base_category_list:
           category_list.append("%s/%s" % (base_category, context.getRelativeUrl()))
 
+      sql_kw = {}
+      if 'limit' in kw:
+        sql_kw['limit'] = kw['limit']
+
       brain_result = self.Base_zSearchRelatedObjectsByCategoryList(
                            category_list=category_list,
                            portal_type=portal_type,
-                           strict_membership=strict_membership)
+                           strict_membership=strict_membership,
+                           **sql_kw)
 
       result = []
       if checked_permission is None:
-- 
2.30.9