[Zope-dev] Re: proxies

Gary Poster gary at zope.com
Wed Jan 16 10:29:07 EST 2008


On Jan 16, 2008, at 3:19 AM, Chris Withers wrote:

> 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.

Although I'm not quite sure which Zope 2 issue you mean by "the weird  
containment/context dual wrapping," I suspect that zc.shortcut's  
traversal proxies do exactly what you want.  An old task of mine is to  
split out this functionality into something like "zc.traversed".  But  
it does what you want, and you don't have to use the shortcuts, and it  
has the necessary bits for it all to work out.

Gary



More information about the Zope-Dev mailing list