Re: [BlueBream] pagination in bluebream

Joshua Immanuel <[email protected]>
Newsgroups gmane.comp.web.zope.devel,gmane.comp.web.zope.bluebream
Organization HiPro IT Solutions Private Limited
Message-ID <1313255662.2427.697.camel@jimman>
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

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEABECAAYFAk5GsOkACgkQWw85XwuSFMIQYQCfaQsdhGawrsvN2e4k8iBeOD24
0XcAn3WxYJcFLC2FEo5cIld/M+YyYuwy
=6JSw
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.