[Zope-dev] ObjectManagers and their children

Phillip J. Eby pje@telecommunity.com
Sat, 06 Nov 1999 01:23:28 -0500


At 05:10 PM 11/5/99 -0800, Jonothan Farr wrote:
>
>> Does anyone know whether Acquisition works in a way which is compatible
with
>> __getattr__?
>
>I'm really interested in the answer to this, too. I had no luck getting
>__getattr__ to work with acquisition when developing the local file system
>product. What are the rules? Is this even possible?

When acquisition wrappers go looking for attributes, they will call your
__getattr__, but it is with an unwrapped self.  This means that acquisition
can use __getattr__ routines, but __getattr__ routines cannot make use of
the object's acquired attributes.

There is *no* workaround, short of rewriting the Acquisition ExtensionClass
and creating an alternative application framework to Zope.  (I actually did
this myself, to solve this very problem of needing "wrapped __getattr__",
but of course the resulting framework can't use Zope products.  Oh well.)