[Zope] total "hits" in dtml-in?

A M Thomas am@virtueofthesmall.com
Tue, 16 Jul 2002 08:00:03 -0400


Hello,

I've just put together my first Zope/MySQL database search interface. 
Gosh that's cool.  However, I have a question. Obviously.

How can I get the _total_ number of returned results for a <dtml-in>
statement (not the number in the current batch)?  This is probably so
obvious that it's staring me in the face, but I can't find it anywhere. 
I even tried (quickly) perusing some source code, but maybe I was
looking in the wrong place.  My main reference has been the Zope book,
another Zope book, and searching the web site.

I know about the cool dtml-in variables like
previous-sequence-start-index, next-sequence-size, etc., but I want to
be able to state on my results form "records 21-40 of X shown" - how do
I gracefully get X?  I know I could do a len() of the query, but that
seems like a bad idea because the database would essentially get queried
twice - once to get the len, and once to create the <dtml-in> list. 
Right?  Am I missing something?  Of course I am.  Any help would be much
appreciated.

Yours,
Am