[Zope-dev] Re: default view

Florent Guillaume fg at nuxeo.com
Mon Jun 19 06:09:42 EDT 2006


Philipp von Weitershausen wrote:
> Lennart Regebro wrote:
>> On 6/18/06, Philipp von Weitershausen <philipp at weitershausen.de> wrote:
>>>> The remaining important question is: if a *default* view is specified
>>>> using the zope 3 mechanism, should we always treat it as a zope 3 view,
>>>> and refuse to lookup an attribute with that name?
>>> Yep. browser:defaultView should only affect the view machinery.
>> OK, that means that the test in Five.browser.tests.test_defaultview
>> lin 94 iw wrong, as it explicitly tests that they CAN be attributes.
>> ;)
>>
>>    This tests whether an existing ``index_html`` method is still
>>    supported and called:
>>
>>      >>> print http(r'''
>>      ... GET /test_folder_1_/testindex HTTP/1.1
>>      ... ''')
>>      HTTP/1.1 200 OK
>>      ...
>>      Default index_html called
>>
>>
>> From Five.browser.tests.defaultview.zcml:
>>
>>  <browser:defaultView
>>      for="Products.Five.tests.testing.simplecontent.IIndexSimpleContent"
>>      name="index_html"
>>      />
>>
>> If you want to have non-views as browser default, we still need to use
>> __browser_default__, then.
> 
> Hmm, perhaps browser:defaultView isn't such a bad idea then... :).
> Actually, I don't have much of an opinion, to be honest. I just thought
> that it would make sense that browser:defaultView only modified the
> behaviour of Zope 3 views. The fact that it also modifies the behaviour
> of the general traversal machinery in Zope 2 sounds like a blessing if
> we get to avoid __browser_default__ this way; if it turns out to be a
> curse for other people, then perhaps we need a five:defaultPublishedName
> or something...

+1 on an alternative spelling, like five:defaultPublishedName or even 
five:defaultView if that's not too error-prone.

Florent

> 
>> The option is to allow attributes, and specify the browserdefault with
>> @@ to force it to be a view.
> 
> Hmm. <browser:defaultView ... name="@@index.html" />??? That doesn't
> sound right.
> 
> Philipp
> 


-- 
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-Dev mailing list