[Zope] Catalog - exclusive-or?

Paul Winkler pw_lists at slinkp.com
Wed Jun 30 15:27:11 EDT 2004


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


More information about the Zope mailing list