[Zope] Access to parents from Python

Pete Kazmier pete@kazmier.com
Fri, 2 Jun 2000 13:44:59 -0400


I've solved my problem.  After toying around a bit this is what I came
up with:

 def ZopeRefreshRoot(self):
     p = self
     while p.getParentNode().getNodeName() == 'GWPoolClass':
         p = p.getParentNode()

Where p is now the topmost object of type 'GWPoolClass'.

On Fri, Jun 02, 2000 at 11:55:56AM -0400, Pete Kazmier wrote:
> Got a quick question ... couldn't seem to find an answer in the
> archives.  I have a container object based on a ZClass, lets call it a
> 'pool', that holds other objects and more of these 'pools'.  
> 
> How do I, in python, traverse up the tree to find the topmost 'pool'?
> I need to execute a method on the topmost 'pool' object which in turn
> will recursively update the cache on every pool in the tree.
> 
> Thanks!!
> Pete
> 
> -- 
> Peter Kazmier                                 http://www.kazmier.com
> PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> 

-- 
Peter Kazmier                                 http://www.kazmier.com
PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654