Hi Peter - getToolByName depends on acquisition to work, and the one place that it doesn't work is in a constructor ;) HTH, Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com
-----Original Message----- From: zope-bounces@zope.org [mailto:zope-bounces@zope.org]On Behalf Of Peter Millar Sent: Sunday, December 05, 2004 8:32 PM To: Zope Subject: [Zope] Why do I get an attribute error when one tool calls anothertool?
I can see that the MemberDataTool is able to call the portal_membership tool using the getToolByName method. (and there are hundreds more examples where this is successful)
But when I try to do it I get an attribute error, (before you ask, yes the first tool has been successfully created first prior to me trying to add this second tool.):
Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Products.CMFCore.utils, line 427, in manage_addTool Module Products.ParasynPIP.ParasynChartTool, line 87, in __init__ Module Products.ParasynPIP.ParasynPIPChartTool, line 80, in getParasynPIPTool Module Products.CMFCore.utils, line 75, in getToolByName AttributeError: parasynpip_tool
My code in the second tool looks like:
def __init__(self): ppt = getToolByName(self,"parasynpip_tool")
Any help anyone could provide would be fantastic, thanks in advance.
My Install is zope 2.7.3, python 2.3, plone 2.0, no other installed products, on windoze, ____________________________________________ Peter Millar
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )