[Zope] strange getPhysicalRoot behaviour

David H bluepaul at earthlink.net
Thu Jul 28 16:36:58 EDT 2005


Robert-Reinder Nederhoed wrote:

> Solved.
>
>
> Thanks for the reactions. It works! My current code looks like this now:
>
> #force function in '/root/functions'
> far = context.restrictedTraverse('/').functions.far
>
> x = foo()
> print far(value=x)
>
>> Of course, it is stupid to make "getPhysicalRoot" private
>> when it is so easy to access the root anyway...
>
> Why not just add 'root' to the script vocabulary?
>
>
If I recall, Casey Duncan suggested putting a python script in *root* 
named ROOT, e.g.

#module ROOT
return container

This is aquirable from anywhere else in Zope and is easy to remember.

David






More information about the Zope mailing list