[Zope-CMF] [dev] CatalogTool as utility
y.2011 at wcm-solutions.de
Mon Sep 19 08:56:24 EST 2011
Hanno Schlichting wrote:
> On Mon, Sep 19, 2011 at 11:57 AM, yuppie<y.2011-E2EsyBC0hj3+aS/vkh9bjw at public.gmane.org> wrote:
>> Currently CMF trunk contains some hacks to work around the catalog brain
>> issues. But I hope there is a better solution. Maybe the ICatalogBrain
>> methods getURL, _unrestrictedGetObject and getObject should have a
>> REQUEST argument that is used instead of self.REQUEST?
>> Any kind of feedback and help is welcome.
> Mmh, why don't we just use zope.globalrequest in ZCatalog directly?
> And create a new ZCatalog 2.14 release series with this. Then we don't
> have to wait for Zope 4.0 to include it.
Using an explicit argument is always cleaner than using
zope.globalrequest. And getObject() already has a (currently unused)
REQUEST argument. And we might be able to provide a migration path for
the API change: If we don't use registerToolInterface, we don't have to
change getObject/getURL calls in places where we still use getToolByName.
But with zope.globalrequest we can avoid modifying the API. So if it is
fine to smuggle a zope.globalrequest dependency in Zope 2.13, that might
be the better solution. Or did you mean to use ZCatalog 2.14 only in CMF?
More information about the Zope-CMF