Catalog improvements (was: Re: [Zope3-dev] Florent's O-R blog entry)

Dieter Maurer dieter at handshake.de
Wed Aug 24 13:31:52 EDT 2005


Martijn Faassen wrote at 2005-8-24 12:27 +0200:
> ...
>Underfeatured query API
>-----------------------
>
>I do think that currently the API to query it is woefully underfeatured.
>
>I've tried to work on this problem and am sitting on some code that just 
>needs a bit of time to polish and release that allows a simple query 
>language on top of the catalog. It's just building up a tree of python 
>objects for queries, nothing special, but it is a lot higher level than 
>what's already there.
>
>Fast, easy batching/sorting
>---------------------------
>
>I don't know how to do easy, efficient batching/sorting with the 
>catalog. I'd like to be able to query *just* a batch of objects, sorted, 
>for user interface purposes. There doesn't seem to be a straightforward 
>way to do this yet, and this is a very common use case. The batching 
>implementation sitting out there in zope.bugtracker.batching is nice, 
>but doesn't deal with the catalog.
>
>I think this should be fixable with a bit more infrastructure though. 
>Getting the right batch is just a query on an index, and the result can 
>be sorted afterwards, though there are tricky issues getting the right 
>batch *size*.

You may have a look at "AdvancedQuery"

  <http://www.dieter.handshake.de/pyprojects/zope>

It uses Python classes to contruct queries with "&" ("and"), "|" ("or")
and "~" ("not") out of elementary classes.


It solves the batching "problem" by means of lazy sorting.
This way, you can use any batching, the catalog does not need
to know about it.

-- 
Dieter


More information about the Zope3-dev mailing list