O'Reilly logo

Professional Plone Development: Building robust, content-centric web applications with Plone 3, an open source Content Management System by Martin Aspeli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3. Searching Objects Using the Catalog

So far, we have discussed the object graph of the ZODB. We can walk this graph, using getattr() to retrieve acquisition-wrapped objects, and we can scan folderish objects using methods such as objectIds(), which returns a list of all the IDs in that container, and objectValues(), which returns a list of contained objects.

Walking the entire ZODB every time we want to find an object is not ideal. In particular, functions such as objectValues() should be avoided if possible, because they can wake up a large number of objects from the ZODB—unpickling them, and swapping them into the ZODB cache. Waking up objects is a relatively slow process, and waking up lots of objects will make your code very slow.

Zope mitigates ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required