[Zope-dev] [BlueBream] pagination in bluebream

Joshua Immanuel josh at hipro.co.in
Sat Aug 13 13:14:22 EDT 2011


Hello all,

Thanks for the replies.

On Fri, 2011-08-12 at 10:34 -0400, Tres Seaver wrote:
> 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.

Then I will go with catalog approach. In this regard I need one more
clarification. 

Say I have an object with following interface

        class IMyObject(Interface):
        
                id = TextLine(title=u'Object ID')
                name = TextLine(title=u'Name')
                ...
                
and say I have registered the catalog like this

        catalog['object_id'] = TextIndex('id', IMyObject)

The 'id' field is same as the key value under which the MyObject is
stored in its parent container. And say if the 'id' field value always
starts with a 'p' so its values are like 'p0001', 'p0002' etc.
So, while searching the catalog I query like this

        catalog.apply({'object_id': 'p*'})
        
I get all the objects from the container as desired :) My problem is
solved, but out of curiosity I am asking this. If I query like this

        catalog.apply({'object_id': '*'})
        
I get the following error 

        ParseError: Query contains only common words: '*'
        
So, How do I query a catalog to return all its objects? 

I guess I can trust the order of objects returned while querying with
_limit option. Because I will be querying for the same keywords n number
of times with just the changing _limit values. Am I right?

Is there any detailed documentation explaining the query format to be
used while querying the catalog other than the documentation in pypi of
zope.catalog?

Thanks

Regards
-- 
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20110813/2ba8ad37/attachment.bin 


More information about the Zope-Dev mailing list