views:

42

answers:

1

I have all objects which get looked up to provide interpreter with both parents objects and object subobjects. I hope to do this without recursion for zope not appreciating this conventional recursion.

I set the view context as root object for recursion to start attaching object on then iterate across this filtered list of intid/objects looking for object that has this object as parent. From there I seek starter code with hopes someone help me.

A: 

Maybe this little trick will be usefull for you as it was for me.
You can restrict your search results by PathIndex (getPhysicalPath) and then just sort it alphabetically:

lst = context.Catalog.searchResults(path='/parentNodeId')
lst.sort()
print lst

You will see something like this:

# /parentNodeId/
# /parentNodeId/folder/
# /parentNodeId/folder/file1.jpg
# /parentNodeId/folder/file2.jpg
# /parentNodeId/folder/file1.jpg
# /parentNodeId/folder2/
# /parentNodeId/folder3/
# /parentNodeId/folder3/file1.jpg
# /parentNodeId/folder3/file2.jpg

I think from this output you can easy build a tree structure

Alex M