[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/pau/groupfolder.
Fixed a one-off bug in search batching.
Jim Fulton
jim at zope.com
Tue Jan 18 18:17:55 EST 2005
Log message for revision 28869:
Fixed a one-off bug in search batching.
Changed:
U Zope3/trunk/src/zope/app/pau/groupfolder.py
U Zope3/trunk/src/zope/app/pau/groupfolder.txt
-=-
Modified: Zope3/trunk/src/zope/app/pau/groupfolder.py
===================================================================
--- Zope3/trunk/src/zope/app/pau/groupfolder.py 2005-01-18 23:13:28 UTC (rev 28868)
+++ Zope3/trunk/src/zope/app/pau/groupfolder.py 2005-01-18 23:17:53 UTC (rev 28869)
@@ -146,7 +146,7 @@
search in groupinfo.description.lower()):
if not ((start is not None and i < start)
or
- (batch_size is not None and n > batch_size)):
+ (batch_size is not None and n >= batch_size)):
n += 1
yield self.prefix+id
i += 1
Modified: Zope3/trunk/src/zope/app/pau/groupfolder.txt
===================================================================
--- Zope3/trunk/src/zope/app/pau/groupfolder.txt 2005-01-18 23:13:28 UTC (rev 28868)
+++ Zope3/trunk/src/zope/app/pau/groupfolder.txt 2005-01-18 23:17:53 UTC (rev 28869)
@@ -158,6 +158,12 @@
>>> list(groups.search({'search': 'two'}))
[u'group.G2']
+They also support batching:
+
+ >>> list(groups.search({'search': 'grou'}, 2, 3))
+ [u'group.GA', u'group.GB', u'group.GC']
+
+
If you don't supply a search key, no results will be returned:
>>> list(groups.search({}))
More information about the Zope3-Checkins
mailing list