AW: [Zope-dev] Re: proxies

Roger Ineichen dev at projekt01.ch
Wed Jan 16 04:40:51 EST 2008


Hi Chris

Probably take a look at the z3c.proxy package.
This implements a IContainer proxy which will proxy
items of a (proxyfied) container. This could give you 
some ideas how you can proxy items on the fly to 
your needs.

The z3c.proxy package contains a README.txt file with some samples.

Also note that you will need the proxy aware copierer and mover if
your objects support copy/paste.

Regards
Roger Ineichen

> Betreff: [Zope-dev] Re: proxies
> 
> 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 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  ** (Related lists -  
> http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )
> 



More information about the Zope-Dev mailing list