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

Andy McKay andy@agmweb.ca
Thu, 28 Nov 2002 10:36:20 -0800


> >       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 '/'.
--
  Andy McKay
  www.agmweb.ca