[Zope] Need help with acquisition
Roché Compaan
roche@upfrontsystems.co.za
Fri, 25 Apr 2003 10:58:18 +0200
Hi there
I want to override __of__ on a ObjectManager subclass to set an
attribute on 'self' but I am having trouble with acquisition.
After I've wrapped 'self' with ImplicitAcquisitionWrapper I still can't
acquire objects higher up in the acquisition tree. It seems as if self
is wrapped in the context of its parent but the parent remains
unwrapped.
def __of__(self, parent):
w_self = ImplicitAcquisitionWrapper(aq_base(self), parent)
w_self.x = w_self.acquired_object.function()
return w_self
I also tried overriding __getattr__ but then 'self' is also unwrapped and
I don't think I can wrap it there anyway since I don't have access to
its parent.
Any ideas on how to do this?
--
Roché Compaan
Upfront Systems http://www.upfrontsystems.co.za