[BlueBream] pagination in bluebream

Tres Seaver tseaver at palladion.com
Fri Aug 12 10:34:13 EDT 2011

Hash: SHA1

On 08/12/2011 08:38 AM, Joshua Immanuel wrote:
> Hello all,
> I am trying to list out items in a container, as the number of
> objects in the container may be large I am trying to paginate them.
> Basically I am trying to implement something like 'LIMIT' and
> 'OFFSET' option available in SQL.
> I found z3c.batching package that does this. For this to work it
> needs the full list. IMHO, loading the entire list of objects on to
> the memory doesn't seem to be a good choice.
> I tried to use zope.catalog to get the object list. But, it has just
> the _limit option to control the output size. And again manipulating
> the _limit value to [offset + limit] and then trimming the results
> doesn't seem to be a clean approach.

That is the accepted mode.  For many applications using pagination, the
percentage of page views which ever use anything but the first batch is
pretty tiny.  Note as well that zope.catalog returns its result as sets
of "document IDs", rather than the real objects, so you don't pay the
cost of pulling the "early" items into the object cache:  you only need
to reify the objects for the "current" batch.

- -- 
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the bluebream mailing list