[Zope-CMF] Question, re: folders w/ thousands of items

sean.upton@uniontrib.com sean.upton@uniontrib.com
Thu, 08 Aug 2002 13:48:41 -0700


Hmm... perhaps there is either a bug or I'm doing something wrong, then, I
think?  The following code still outputs results from an entire hierarchy of
paths underneath, and changing the level to 1 causes results to be empty no
matter what object context is referring to:


path = context.getPhysicalPath()
pathstr = ''
for item in path:
    pathstr = pathstr + '/' + item
pathstr = pathstr[1:]  #pathstr ends up being something like
'/CMFSite/SomeFolder'
results = context.portal_catalog(path={'query':pathstr, 'level':0})[:10]


I got started by looking at http://www.zopelabs.com/cookbook/1001898394, but
this example doesn't really deal with level.  I'm interested in getting, for
example, sibling items in a folder without getting items contained in
siblings... Thoughts?

Sean


-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: Thursday, August 08, 2002 12:37 PM
To: sean.upton@uniontrib.com
Cc: zope-cmf@zope.org
Subject: RE: [Zope-CMF] Question, re: folders w/ thousands of items


sean.upton@uniontrib.com writes:
 > ...
 > Using Catalog results really speeds up
 > the UI over using OM methods, but I would like to be able to use
PathIndexes
 > to get what I am after (a quick, cached replacement for using
 > objectValues(), that has sorting, and easy limitation of result sets).
This
 > leaves me with several questions:
As I understand it, a "level=0" should give you what you want.


Dieter