Roger Ineichen wrote:
Jim Fulton schrieb:

Hi Jim,

We just use a IContainer location proxy adapter.
But since this adapter isn't persistent I don't think this
is a problem.

def proxify(container, item):
    if IContainer.providedBy(item):
        proxy = ContainerLocationProxy(item)
        proxy = LocationProxy(item)
    proxy.__name__ = item.__name__
    proxy.__parent__ = container
    return proxy

class ContainerLocationProxy(LocationProxy):
    """Proxy the location of a container an its items."""

    def __getitem__(self, key):
        return proxify(self, getProxiedObject(self).__getitem__(key))


Well, with the fix, your __getitem__ won't be called. Is that a
problem? ;)

You will need to use the @non_overridable decorator on your __getitem__

If I understand this correctly, then we only have to update the methods with decorators?

I believe so.

If so, this will be fine for me.



Jim Fulton           mailto:[EMAIL PROTECTED]       Python Powered!
CTO                  (540) 361-1714  
Zope Corporation
Zope3-dev mailing list

Reply via email to