[Zope3-dev] defaultView cannot take class as for

Jim Fulton jim at zope.com
Thu Sep 8 06:31:32 EDT 2005


Martijn Faassen wrote:
> Martijn Faassen wrote:
> 
>> Jim Fulton wrote:
>>
>>> Martijn Faassen wrote:
>>>
>>>> While the browser:page directive can take a content class for its 
>>>> 'for' attribute (instead of an interface), the browser:defaultView 
>>>> directive doesn't accept this. I tried changing the interface of the 
>>>> defaultView directive so it also accepts classes, but that by itself 
>>>> does not appear to make it work. This somewhat limits the utility of 
>>>> the ability to pass in classes instead of interfaces to the page 
>>>> directive; the point is to have a shortcut so an interface doesn't 
>>>> always need to be defined.
>>>>
>>>> Before I dig deeper, I'd first like to know whether this would 
>>>> indeed be considered to be bug? If so, should I check this into 
>>>> trunk or also the Zope 3.1?
>>>
>>>
>>> The intent was to deprecate the use of the defaultView directive to
>>> specify anything but the default view name.  This decision was made
>>> before we had a deprecation mechanism.
>>>
>>> The recommended way to create a default view is to create a view named
>>> "index.html", which can be done with the page directive.
>>
>>
>> Aaah, I didn't realize that. I'll just use that then.
> 
> 
> Hm, after talking to JW here I'm confused again. (though I think 
> index.html will work in this case).
> 
> Is the following construction deprecated?
> 
> <defaultView name="foo" for="..." />
> 
> If not, then my complaint is that 'for' only accepts interfaces, not 
> classes, while the 'for' for the page directive also accepts classes.

OK. This is a bug.

> So, as far as I understand, I am not trying to use defaultView for 
> anything but specifying the default view name, but for a class, not an 
> interface.

Right.  I missunderstood your previous note. Sorry.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list