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)
    else:
        proxy = LocationProxy(item)
    proxy.__name__ = item.__name__
    proxy.__parent__ = container
    return proxy

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

    # zope.app.conatiner.interfaces.IReadContainer
    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__
function.

If I understand this correctly, then we only have to update the methods with decorators? If so, this will be fine for me.

Jim


--
Regards
Roger Ineichen
_____________________________
Projekt01 GmbH
www.projekt01.ch
Boesch 65
6331 H├╝nenberg
phone     +41 (0)41 781 01 78
mobile    +41 (0)79 340 52 32
fax       +41 (0)41 781 00 78
email [EMAIL PROTECTED]
_____________________________
END OF MESSAGE
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to