[Zope-dev] Re: Problems with non-zope object attribute access

Max M maxm at mxm.dk
Fri Mar 11 05:32:13 EST 2005


Dario Lopez-Kästen wrote:

> I have tried the following in my product class:
> 
>     def _zopify(self, o):
>         # wrap object o in a an Acquisition.ImplicitAcquisitionWrapper
>         # add __allow_access_to_unprotected_subobjects = 1
>         # Return o
>         o.__allow_access_to_unprotected_subobjects = 1
>         return Acquisition.ImplicitAcquisitionWrapper(o, self)
> 
> and in my product code I do this.
> 
>         plist = get_non_zope_person_object_list(...)
>         return [self._zopify(person) for person in plist ]


btw. if setting __allow_access_to_unprotected_subobjects = 1 on the 
object doesn't work, the ImplicitAcquisitionWrapper most likely sets it 
to something else.

have you tried changing the order?

     w = Acquisition.ImplicitAcquisitionWrapper(o, self)
     w.__allow_access_to_unprotected_subobjects = 1
     return w


-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science



More information about the Zope-Dev mailing list