[Zope3-dev] Florent's O-R blog entry

Dieter Maurer dieter at handshake.de
Wed Aug 24 14:52:27 EDT 2005


Martijn Faassen wrote at 2005-8-24 17:28 +0200:
> ...
>In your example you haven't done a join as I describe above, unless I 
>miss something. The essential part is that I want an object with state 
>'PUBLISHED' unless there is another object where field 'ID' is the same 
>as this object that is with state 'NEW'. The join is in the 'ID' 
>matching part.

He cannot show this, because "AdvancedQuery" does not support joins.

You can get simple joins by combining several queries
and using the result of previous queries in the construction
of following ones -- using the power of Python as a gluing language.


Note that the general "join" concept drastically changes the
meaning of a query:

   As soon as you have a join, the result is no longer a
   sequence of objects but a sequence of tuples of objects.

   The tuple length corresponds to the number of catalog copies
   you have joined (as the catalog does not have separate tables,
   it itself is the only available table that can be joined).

   Note further, that only "FieldIndex"es can be used
   to optimize the join operation. With other indexes
   (e.g. "Keyword" or "Text"), joining would become
   a very fuzzy concept.


-- 
Dieter


More information about the Zope3-dev mailing list