[Zope-CMF] [dev] CatalogTool as utility

Martin Aspeli optilude+lists at gmail.com
Mon Sep 19 12:09:51 EST 2011


On 19 September 2011 14:56, yuppie <y.2011 at wcm-solutions.de> wrote:

> Hi!
>
>
> 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?
>
>
getURL() is an extremely common operation, and is often called in TALES
expressions.

-100 on making it take a mandatory request parameter when there are other
solutions available.

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-cmf/attachments/20110919/239158a5/attachment.html 


More information about the Zope-CMF mailing list