[Zope] Showing the results per pages.

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Mon Aug 1 17:10:51 EDT 2005


Fernando Lujan wrote:

>HI,
>
>I have a sql-method which returns a dinamic number of tuples. How can
>I split it and show the result using a per page separation?
>
>Something like Google's results when we have a huge number of results... ;)
>
>Thanks.
>
Maybe try 'Z Search Interface' in ZMI from the Add list. It will 
generate simple
zpt page with batched results. Unfortuantelly it only has next, previous 
links,
and no numbered links to page "1, 2, 3 ..." so if you need this then
I think you'll have to write something on your own.
Take care that the result is taken to the batch as a whole set from
database (speed!). It may be good idea to use slicing directly in database
queries (eg. 'limit' and 'offset' clauses in postgres) but then you'll 
have to
write a script that will manage this.

-- 
Maciej Wisniowski


More information about the Zope mailing list