[Zope-CMF] Upgrading to CMF 1.2 error
Tres Seaver
tseaver@zope.com
Wed, 24 Apr 2002 09:39:34 -0400 (EDT)
On Tue, 23 Apr 2002, Dieter Maurer wrote:
> J.C.Mcnulty@open.ac.uk writes:
> > I was wondering if someone could help me. I am running Zope 2.5.1b2 with CMF
> > 1.1 (python 2.1). I want to upgrade to CMF 1.2 but when I do and try to
> > publish an item I get the following error:
> >
> > Error Type: TypeError
> > Error Value: hasReplies() takes exactly 2 arguments (1 given).
> Apparently, someone gave "hasReplies" a (silly) second parameter.
>
> The parameter is not used in the body and it makes "hasReplies" inconsistent
> to "listReplies". Thus, it is really silly...
>
> Either fix "hasReplies" or give it a second argument...
Here is the definition of DiscussionItemContainer.hasReplies::
def hasReplies( self, content_obj ):
"""
Test to see if there are any dicussion items
"""
outer = self._getDiscussable( outer=1 )
if content_obj == outer:
return not not len( self._container )
else:
return not not len( content_obj.talkback._getReplyResults() )
Note that DIC is the class of the 'talkback' object; it needs
the second paramter to know whether you are asking for a particular
item or for the "top-level" content object.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.org