[Zope-dev] Catalog performance

Chris Withers chrisw at nipltd.com
Thu Sep 11 15:37:54 EDT 2003


John Barratt wrote:
> docs = container.portal_catalog(meta_type='Document', ...)
> for doc in docs:
>     obj = doc.aq_parent.unrestrictedTraverse(doc.getPath())
>     was_ghost = obj._p_changed is None
>     value = obj.attr
>     if was_ghost:obj._p_deactivate()

Bear in mind though, that you can only do this in an external method...

Chris




More information about the Zope-Dev mailing list