On 4/7/10 9:47 AM, Charlie Clark wrote:
> Am 07.04.2010, 15:41 Uhr, schrieb Chris McDonough<chr...@plope.com>:
>>> I noticed in the 1.2 docs that view configuration in zcml uses the
>>> 'context' predicate instead of the zope 'for' predicate. Just wanted to
>>> know if I can still safely use 'for' or whether new code should switch
>>> all those.
>> The "for" spelling will continue to work "forever".
> After Iain pointed this out I checked the book. "View" seems to relate to
> a specific object class rather than interface and I can imagine is a
> convenience for the very common case where interfaces have only a single
> implementation. Is this assumption correct?
Yes. This is a general feature of zope.component; if you register an adapter
using a class as the "for" (instead of an interface), the adapter will be found
during lookup if the adapted object is an instance of that class.
Repoze-dev mailing list