[Zope-CMF] getToolByName gives an AttributeError

Tres Seaver tseaver@zope.com
Tue, 18 Dec 2001 12:38:54 -0500


Gitte Wange wrote:

> I have a small problem here.
> In one of my products I want to use the portal_catalog in order to find
> some objects.
> 
> So I do this:
> from Products.CMFCore.utils import getToolByName
> 
> and when getting the catalog I do this:
> catalog = getToolByName(self, 'portal_catalog')
> 
> But this raises an error (in line 50 of utils.py).
> 
> I am using the CVS checkout of CMF - could the error be here ??

'getToolByName' is ubiquitous in the CMF code;  I can't imagine

that it is fundamentally broken here.  Could you perhaps have an
unwrapped object (one with no acquisition context)?

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com