Chris Withers writes:
 > Dieter Maurer wrote:
 > > 
 > > What you probably need:
 > > 
 > >   derive a new ObjectManager from Acquisition.Explicit and
 > >   the current ObjectManager.
 > > 
 > >   provide an interface to manage the attributes that should
 > >   be acquired implicitly.
 > 
 > Well, I had a go at this, but not quite in the way you describe.
 > 
 > I subclassed Folder and overrode __getattr_ with:
This does not work because Python calls "__getattr__" only,
if it can not find the attribute through "normal" means.
Due to the implementation of "Acquisition", acquired attributes
are found by "normal" means bypassing "__getattr__".

You may be successful, if you override "__of__".
It is this method that (usually) builds the acquisition wrapper.
You can try to build an explicit rather than implicit acquisition
wrapper.

The easiest way, of course, is to derive the class from
"Acquisition.Explicit" with higher priority (more to the left)
than from "Acquisition.Implicit".


Dieter

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to