How can I iterate over content in a portal in exactly the order it appears to Users?
portal_catalog(sort_on=["path", "getObjPositionInParent"])
does not help because getObjPositionInParent
is never used because the id of the object is in the path.
The only ideas I have right now:
-
Add a custom index
parent_path
and doportal_catalog(sort_on=["parent_path", "getObjPositionInParent"])
. -
Instead of doing one query do a query for each container somehow using the index
is_folderish
andpath
: -
Walk the tree instead of using a catalog-query.