[Zope] Count specific objects

Rik Hoekstra rik.hoekstra@inghist.nl
Thu, 25 May 2000 22:04:58 +0200


>In subfolder "ref_links" I have a another folder called myLinksandURLs
>(which actually is a product called URL Directory).
>In that folder (myLinksandURLs) there are a couple of objects called Simple
>URL derived from the product called URL Directory.
>
>I  now want to count the number of 'Simple URL' .
>I have tried this. <dtml-var "_.len('Simple URL')"> but that counts only
the
>number of letters in Simple URL.
>
>How do I tell the _.len function to count how many objects exists in a
>specific folder?


<untested>
  <dtml-var "_.len(<specificFolder>.objectValues(['Simple URL']))">
</untested>

if the specificFolder is the current folder it may be omitted

Rik