[Zope3-dev] personal conceptual questions

Paul Winkler pw_lists@slinkp.com
Wed, 7 May 2003 09:24:04 -0400


two points...

On Wed, May 07, 2003 at 09:03:19AM +0200, Marcus J. Ertl wrote:
> Have I realy to build a index for each of this things? And have to keep
> it in sync by my own? Isn't there a easy way to get to my messages?

what's wrong with building indexes?  sure, building an index the first
time is slow, but after that you can get the catalog to keep itself
up to date (at least in zope 2 this is not hard, i haven't tried it
in zope 3 but i assume this is still a common use case).
Once you have the indexes, using the catalog will be much much faster
than walking the tree.

> I think, we realy need something like SQL for Zope3, calling it ZQL...
> a Zope Query Language, or a Query Service (I read some pages about it,
> but got no feeling how it should work!).

there has been some discussion lately, on this list and on zope-dev,
of adding relationships to zope, which would allow you to ask an object
for related objects according to some criteria. 

> I need an easy way to ask for objects recursivly under a certain
> subfolder, using all of the objects direct and indirect (accassible per
> adapter) properties.
>
> something like:
> 
>   list = ZopeQuery(self, "owner='myself' and workflow.state='pending'
> sort by date limit 20 offset 40")

if I read this right (i'm an SQL dummy), we can already do that in 
zope 2, just without the syntactic sugar. Something like:

results = context.SomeCatalog(owner='myself', workflow_state='pending',
                              sort_on = 'bobobase_modification_time')

from ZTUtils import Batch
my_list = Batch(results, size=20, start=40)


-- 

Paul Winkler
home:  http://www.slinkp.com
"Muppet Labs, where the future is made - today!"