[Zope] getRoot() how?

Andreas Jung andreas@andreas-jung.com
Sun, 3 Mar 2002 19:32:33 -0500


getPhysicalRoot() ?!

 - aj
----- Original Message ----- 
From: "Peter Bengtsson" <mail@peterbe.com>
To: <zope@zope.org>
Sent: Sunday, March 03, 2002 17:40
Subject: [Zope] getRoot() how?


> In a product class I want to add a method that returns the root of the 
> instance.
> 
> Suppose I have this URL:
> http://localhost:8080/myProductInstance/subfolder/foldersub/useRoot()
> 
> Method useRoot() will get the 'myProductInstance' object and add some 
> properties to it.
> 
> To do this you would do:
> 
> root_instance = self.myProductInstance
> 
> But I can't know the name of the instance of course.
> This would be another method:
> 
> root_instance = self.superValues('Product Meta Type')[0]
> 
> Neither method is very neat. Is there a OO command to immediatly get the 
> root of the instance?
> 
> 
> Peter
> 
> 
> _______________________________________________
> 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 )
>