[Zope3-dev] defaultView cannot take class as for
Jim Fulton
jim at zope.com
Wed Sep 7 13:49:11 EDT 2005
Martijn Faassen wrote:
> Hi there,
>
> 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.
If you want the default view to have a different name, then it is
recommended to use defaultView to specify that name and then use
some other view directive (e.g. page) to configure a view that has
that name.
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