[Zope-dev] Re: proxies
Chris Withers
chris at simplistix.co.uk
Wed Jan 16 03:19:38 EST 2008
Philipp von Weitershausen wrote:
>> - can these proxies be used to keep track of a traversal path in much
>> the same way (although no seperate containment and context chains
>> needed) as the old Zope 2 acquisition wrappers did?
>
> We generally assign a __parent__ attribute to objects that have a
> hierarchical parent object.
Okay, but I'm talking about a context-based chain, ie: keeping track of
what objects were traversed through to obtain the current object.
Traversed here does *not* mean Zope 3 url traversal which si why I'm
looking for something akin to Zope 2's acquisition wrappers, but without
the weird containment/context dual wrapping.
>> - once a proxy has been created, the the object it's proxying for be
>> replaced?
>
> I don't understand this question.
>>> x = proxy(y)
>>> a.x = x
>>> b.x = x
I now want to do something like:
>>> x.replace(y,z)
...so a and b will still keep their references, but the object being
proxied for has been changed.
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope-Dev
mailing list