[Zope] Building a site tree with the ZCatalog

Nico Grubert nicogrubert at gmail.com
Wed Oct 22 04:11:41 EDT 2008


> And how do you think ExtendedPathIndex help with sorting here?
> 
> In this case, some custom sorting would be required in a python method or view.

It's the combination of both the indexes "position" and the 
"ExtendedPathIndex" which provides a depth parameter that solved my problem.
No expensive object calls which results in heavy CPU usage if your tree 
contains severy hundres or even thousands of items.


@ Martijn
I used this for a Silva CMS Site to create a Navigation Tree. After this 
project has been gone online (expected in the next 1 or 2 weeks) I'll 
write a how-to to share this to other Silva developers.
My first attempt was to use the "_get_container_tree()" method provided 
by Silva and cached the result as a list of dictionaries. Unfortunately 
the initial call took several minutes (I have a huge tree) and the 
system was almost frozen during that time.

Thanks for the ExtendedPathIndex tip, Andreas. The usage of the "depth" 
parameter is exactly what I needed to recursively go through the tree 
without any object-wakups.

Regards,
Nico


More information about the Zope mailing list