[Zope] getRoot() how?
Peter Bengtsson
mail@peterbe.com
Sun, 03 Mar 2002 23:40:03 +0100
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