[Zope-CMF] Upgrading to CMF 1.2 error
Fri, 26 Apr 2002 19:42:53 +0200
Tres Seaver writes:
> On Tue, 23 Apr 2002, Dieter Maurer wrote:
> > ....
> > 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 )
> 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.
Sorry! You are right.
"hasReplies" has 2 arguments and uses both.
But "getReplies" has only a single one and one would expect that
"hasReplies() == (len(getReplies()) != 0)".