[Zope] __getattr__ and getPhysicalRoot()

Dieter Maurer dieter at handshake.de
Thu Apr 29 18:16:16 EDT 2004


Stefan Bund wrote at 2004-4-29 17:17 +0200:
>I have been trying to implement a special __getattr__ hook now for
>some time and have come to a dead end. I know, __getattr__ hooks are
>evil and you should never need theme. I have read the threads about
>__getattr__ in the zope-dev list-archive. But I still need this.
>
>I want to implement a special reference pattern (Something like a
>combination of PortableHole and TransparentFolder). To this end, I
>need access to a Zope object specified by its absolute path
>(getPhysicalPath()) inside the __getattr__ method. The Problem is,
>__getattr__ is often called without an acquisition wrapper and
>therefore has no direct access to the Zope root object.

Indeed.

You may have a look at my "Reference" product and
see how I tackle a similar problem:

  <http://www.dieter.handshake.de/pyprojects/zope>


-- 
Dieter



More information about the Zope mailing list