[Zope3-dev] Re: "for" attribute not checked in zcml

Christophe Combelles ccomb at free.fr
Sun Jun 10 07:36:03 EDT 2007


Martin Aspeli a écrit :
> Christophe Combelles wrote:
>> Hello,
>>
>> Many zcml directives have a "for" attribute, which take an interface 
>> as argument. Absent-minded people like me sometimes happen to put a 
>> real class instead of an interface in the "for" attributes.
>>
>> * On browser:page, one can put a real class with no error. Is it correct?
> 
> Yes. Browser views are just adapters, and adapters can be registered for 
> a specific class, as well as for an interface. Think of a class as being 
> an interface which is implemented by a single class only (itself).


Does it mean I can have both a generic view for an interface, and a specific 
view for a particular implementation of that interface ?



More information about the Zope3-dev mailing list