[Zope] re: Length of results set

Ken ken@p11.org
Thu, 16 Jan 2003 17:39:27 +0100 (CET)


Hi again,

Maybe I'd better re-phrase my question. I think it will be easy for many of you, maybe even me.. I had too much coffee last night. 

How do you get the length of results for a <dtml-if> inside a <dtml-in> ?

It can't really have anything to do with <sequence-length>, and I've tried a few ideas using "._len(...)" but to no avail.

In Beno's now famous example, how to report the number of objects where "folder==lang" ? 

 > <dtml-let lang="REQUEST.get('HTTP_ACCEPT_LANGUAGE','en-us')">
 >   <dtml-in objectValues>
 >    <dtml-let folder=id>
 >     <dtml-let langShort=lang[2:]>
 >      <dtml-var langShort>
 >      <dtml-if expr="folder==lang">
 >       <dtml-var lang>
 >      </dtml-if>
 >     </dtml-let>
 >    </dtml-let>
 >   </dtml-in>
 > </dtml-let>

Like Beno, I'll write a Python script next time, I promise...

Thanks!

Ken