[Zope] How to access Zope root in Script (Python)

Oliver Bleutgen myzope@gmx.net
Thu, 28 Nov 2002 20:46:06 +0100


Andy McKay wrote:

>>>      root = container.restrictedTraverse('/')
>>>
>>> The second one is possibly the simpler way to do it.
>>>
>>
>>And it doesn't work, because restrictedTraverse traverses the path  down
>>from the ObjectManager it's called on, i.e. its argument is the path
>>relative to container in your example.
>>
> 
> Oh yes it does, works fine for me in Zope 2.6.
> 
> In OFS/Traversable.py line 95 the it calls getPhysicalRoot() if the path
> starts with a '/'.


Oh, sorry then, this must have got changed in some zope version. Ok, I 
learned something.

cheers,
oliver