[Zope-CMF] IndexableObjectWrapper

Martin Aspeli optilude+lists at gmail.com
Tue Mar 10 10:35:54 EDT 2009


yuppie wrote:

> AFAICS wrapping the object before looking up adapters is unnecessary. 
> The catalog should do the lookup directly and the existing features 
> provided by IndexableObjectWrapper should be reimplemented as adapters.

Bear in mind that there is a difference between getting the wrapper 
itself, and getting the value to catalogue for a particular *attribute* 
of the wrapper (e.g. allowedRolesAndUsers).

The CatalogTool subclass in Plone solves the former. plone.indexer uses 
the hook it puts in place to solve the latter.

I think at a minimum, CMF should just make the whole wrapper swappable 
by looking it up as an adapter. Then people could choose to use 
plone.indexer if they so needed (we'd obviously need to change 
plone.indexer to provide an appropriate adapter based on a CMF interface 
rather than a Plone one, and then deprecate the Plone version). For 
smaller applications, it may just be unnecessary complexity.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book



More information about the Zope-CMF mailing list