[Zope-CMF] [dev] tools as utilities
Jens Vagelpohl
jens at dataflake.org
Mon Sep 12 05:00:49 EST 2011
On Sep 12, 2011, at 11:52 , yuppie wrote:
> Hi!
>
>
> 5 years ago we started converting CMF tools into local utilities, and we
> are still stuck in the middle of that task.
>
> The problem is that local utilities don't have REQUEST in their
> acquisition chain. A few tool methods use self.REQUEST and the plan was
> to replace these methods by view code. But that never happened. So these
> tools and all tools depending on these tools are still not converted.
>
> I propose to use 'five.globalrequest' instead of self.REQUEST inside
> tools. AFAICS that allows to convert *all* tools into utilities.
Hi Yuppie,
Why would you want to add a dependency for 3 lines of code? All that package does is register a 1 line event handler. I'd rather do that in the CMF itself.
IMHO the "cleaner" way would be to make sure the request object is explicitly passed into any code that needs it.
jens
More information about the Zope-CMF
mailing list