[Zope] Simple, I think!

Joel Burton jburton@scw.org
Wed, 25 Jul 2001 17:18:44 -0400 (EDT)


On Wed, 25 Jul 2001, Sheree Beaudette wrote:

> I've looked everywhere and I think this should be simple but I'm not getting
> it
> 
> 
> I simply want to count the number of records generated by an ZSQL Method
> (SQL query) within a DTML Method (something like get the record count of
> that certain query).  I then want to refer to this number (could be zero if
> there are no records) and say if this number is zero then do something, else
> do something else.

w/in the <dtml-in> loop, sequence-length holds this (not just for ZSQL,
but for *all* sequences). So:

<dtml-in allStaff>
  ... list each staff person ...
  <dtml-if sequence-end>
    we have <dtml-var sequence-length> staff members.
  </dtml-if>
<dtml-else>
  <b>how strange</b>. we have no staff
</dtml-in>

-- 
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington