[Zope] Catalog - exclusive-or?

Andreas Jung lists at andreas-jung.com
Wed Jun 30 15:33:10 EDT 2004


I think you can't achive that without postprocessing. The indexes 
themselves only
know about 'or' and 'and' but not about 'xor'.

-aj

--On Mittwoch, 30. Juni 2004 15:27 Uhr -0400 Paul Winkler 
<pw_lists at slinkp.com> wrote:

> Hi,
>
> I have a bunch of objects (CMF content but I don't think that's
> relevant to the question) which are conceptually closely
> related - they are different versions of the same content.
> I want to be able to ensure that a search returns at most one
> of the related objects. I can't think of any way to do this
> with stock ZCatalog, and I've been looking at Dieter's
> AdvancedQuery but can't quite sort it out there either.
> The semantics I want are like this:
>
>     given a FieldIndex F, an object o, and a query parameter foo,
>         o is a match if
>             o's value for F is foo
>         or
>             o's value for F is "default" AND there are no relatives
>             of o whose value for F is foo
>
> I think I could implement this with a bunch of post-processing of
> the query results, but that seems likely to be slowwww.
>
> any ideas?
>
> --
>
> Paul Winkler
> http://www.slinkp.com
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )






More information about the Zope mailing list