Bug in the doc or I missed something
Hi, The zope help in the API/ObjectManagerItem section mentions the "getPhysicalRoot()" that returns the zope root object. In a Python script... x = anyobject.getPhysicalRoot() ...raises an AttributeError, but... x = anyObject.getPhysicalPath() ...works perfectly. When bot methods are supposed to be provided by the same base class !!! Did I miss something or does the help mention a deprecated method (I noticed the problem on 2.6.1 and 2.6.2, I have no older version to check) Thanks in advance. --Gilles
Gilles Lenfant wrote:
Hi,
The zope help in the API/ObjectManagerItem section mentions the "getPhysicalRoot()" that returns the zope root object. In a Python script...
x = anyobject.getPhysicalRoot()
...raises an AttributeError, but...
x = anyObject.getPhysicalPath()
...works perfectly. When bot methods are supposed to be provided by the same base class !!!
Did I miss something or does the help mention a deprecated method (I noticed the problem on 2.6.1 and 2.6.2, I have no older version to check)
Thanks in advance.
--Gilles
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
getPhysicalRoot is only available in python product code, see the API reference:: getPhysicalRoot(): Returns the top-level Zope Application object. Permission Python only , bernd
----- Original Message ----- From: "Bernd Dorn" <zope-mailinglist@mopa.at> To: <zope@zope.org> Sent: Thursday, October 23, 2003 4:56 PM Subject: Re: [Zope] Bug in the doc or I missed something
Gilles Lenfant wrote:
Hi,
The zope help in the API/ObjectManagerItem section mentions the "getPhysicalRoot()" that returns the zope root object. In a Python script...
x = anyobject.getPhysicalRoot()
...raises an AttributeError, but...
x = anyObject.getPhysicalPath()
...works perfectly. When bot methods are supposed to be provided by the same base class !!!
Did I miss something or does the help mention a deprecated method (I noticed the problem on 2.6.1 and 2.6.2, I have no older version to check)
Thanks in advance.
--Gilles
getPhysicalRoot is only available in python product code, see the API reference::
getPhysicalRoot():
Returns the top-level Zope Application object.
Permission Python only
, bernd
Thanks Bernd, The bug was in my understanding :) "Python only" could mean "python ttw scripts too". The strange thing is it raises an AttributeError rather than a Unauthorized exception. Anyway I found a workaround for that stupid limitation that works in my case : root = container.restrictedTraverse('/') --Gilles
In a PythonScript use: context.restrictedTraverse('/') Stefan --On Donnerstag, 23. Oktober 2003 16:07 +0200 Gilles Lenfant <gilles@pilotsystems.net> wrote:
Hi,
The zope help in the API/ObjectManagerItem section mentions the "getPhysicalRoot()" that returns the zope root object. In a Python script...
x = anyobject.getPhysicalRoot()
...raises an AttributeError, but...
x = anyObject.getPhysicalPath()
...works perfectly. When bot methods are supposed to be provided by the same base class !!!
Did I miss something or does the help mention a deprecated method (I noticed the problem on 2.6.1 and 2.6.2, I have no older version to check)
Thanks in advance.
--Gilles
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/
participants (3)
-
Bernd Dorn -
Gilles Lenfant -
Stefan H. Holek