Jeff, fwiw, to sidestep the problem with your current implementation,
and just try to address some possible solutions, we also replace the
standard contents view, but we do it generally--for the default
layer. There are at least a couple of ways to do that (zcml
overrides and custom folder instances with their own associated
views). Looking that way might get you past what sounds like a
possible time crunch.
That's not to dissuade you from continuing to explore your current
avenue: it's just offered as a possible practical way out, maybe
while you figure out your original approach.
On the other hand, to try to answer what I think was one of your
recent questions, directlyProvided interfaces are more important for
a match than interfaces from a class.
>>> from zope import interface
>>> class IFoo(interface.Interface):
... pass
...
>>> class IBar(IFoo):
... pass
...
>>> class IBaz(interface.Interface):
... pass
...
>>> class Bar(object):
... interface.implements(IBar)
...
>>> bar = Bar()
>>> interface.directlyProvides(bar, IBaz)
>>> interface.providedBy(bar).__iro__
(<InterfaceClass __main__.IBaz>, <InterfaceClass __main__.IBar>,
<InterfaceClass __main__.IFoo>, <InterfaceClass
zope.interface.Interface>)
I believe that's pertinent. :-)
I'm pretty sure there's a proposal on the wiki somewhere with Jim's
full lookup algorithm that you want, but the iro for the pertinent
object(s) usually gets me far enough.
HTH
Gary
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com