[Zope-CMF] Re: How to count the number of replies?

Ausum augusto@artlover.com
Sat, 21 Jul 2001 11:54:41 -0500


Thanks Tres.

This is the code I came up with, to count the number of replies from an
object, listed at a typical portal_catalog list:

<dtml-with getObject>
<dtml-if talkback>
  <dtml-let hasReplies="talkback.hasReplies( this() )">
    <dtml-if hasReplies>
      <dtml-var "talkback.replyCount( this() )">       
    </dtml-if>
  </dtml-let>
</dtml-if>
</dtml-with>

Put in a method it works fine, but I'm supposing that due it has to call
every found object in order to tell whether it has replies or not, it is
somehow costly. Shouldn't 'num_of_replies' be a catalogable object's
property, updated by the workflow? How do I perform this?

Thanks in advance,


Ausum



Tres Seaver wrote:

> 
> 'obj.talkback.replyCount( obj )', I think (I didn't add the feature,
> but that is what the signature implies).
> 
> Tres.
> --
> ===============================================================
> Tres Seaver                                tseaver@digicool.com
> Digital Creations     "Zope Dealers"       http://www.zope.org