[Zope] Child/Parent Object Searches

Casey Duncan cduncan@kaivo.com
Wed, 18 Apr 2001 14:51:38 -0600


complaw@hal-pc.org wrote:
> 
> I'm not quite sure that Zope is the tool for this problem, so I'm asking the
> experts.  This is the problem.
> 
> I have a PAT object, this PAT object is a folderish thing that can contain other
> PAT objects (as children of the parent) and also PRIO objects, which pertain to
> the particular PAT.  The hierarchy can look something like this...
> 
> PAT_1 -- PRIO_1, PRIO_2, PRIO_3
>  |
>  +-- PAT_2 -- PRIO_4, PRIO_5, PRIO_6
>  |     }
>  |     +-- PAT_3 -- PRIO_7, PRIO_8, PRIO_9, PRIO_10, PRIO_11
>  |
>  +-- PAT_4 -- PRIO_12, PRIO_13
> 
> I want the users to be able to load various PRIO objects into a particular PAT
> folder.  Moreover, and most importantly, if I am viewing the PAT_3 object, I
> need to be able to list all of the PRIO objects in all of the other related PAT
> objects (i.e., get a list including PRIO_1 through PRIO_13).
> 
> Is there some type of query statement (to the ZODB) that I could return such a
> list?
> 
> Cheers,
> 
> Ron
> 

Acquisition is a powerful tool to relate objects in this way. Folderish
objects have a method called superValues() that might help you out. It
returns a list of object within and above a given folder.

I'm a bit unsure how/why PAT_3 relates to all other PAT/PRIO objects.
Could you expand on that?

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>