[Zope-CMF] [dev] CatalogTool as utility

Hanno Schlichting hanno at hannosch.eu
Thu Sep 22 08:55:56 EST 2011

On Thu, Sep 22, 2011 at 3:14 PM, yuppie <y.2011 at wcm-solutions.de> wrote:
> My checkin for Products.ZCatalog has an optional dependency on
> five.globalrequest. If five.globalrequest is not installed,
> Products.ZCatalog behaves exactly as before. I hope we don't need a
> Products.ZCatalog 2.14 release for that. Zope 2.13 can use it without
> five.globalrequest.
> See http://svn.zope.org/?rev=122892&view=rev
> Is that ok? Should I add an explicit extra in the setup.py of
> Products.ZCatalog?

That's ok. One minor nitpick: Instead of writing:

request = getattr(self, 'REQUEST', None)

I'd write:

request = aq_get(self, 'REQUEST', None)

with a module import of:

from Acquisition import aq_get

That way objects which have only an explicit AQ chain or only
__parent__ pointers will also work.


More information about the Zope-CMF mailing list