[Framework-Team] Re: Body class

Wichert Akkerman wichert at wiggy.net
Sun Jan 17 20:38:38 UTC 2010


On 2010-1-17 21:36, Hanno Schlichting wrote:
> On Sun, Jan 17, 2010 at 9:19 PM, Wichert Akkerman<wichert at wiggy.net>  wrote:
>> On 2010-1-17 16:52, Hanno Schlichting wrote:
>>>
>>> mark_view
>>> have_portlets
>>> hide_columns
>>> renderBase
>>> bodyClass
>>
>> is_view_template or whatever it is that manages IViewView. We've found it to
>> be very painful to manage IViewView now. In particular it appears to be
>> impossible to set when you render a template from a browser view.
>
> mark_view actually sets the IViewView interface. The main_template does:
>
> view nocall:view | nocall: plone_view;
> dummy python: plone_view.mark_view(view);
>
> which you should be able to do in any template that doesn't use
> main_template. Otherwise it should work just fine to add
> "implements(IViewView)" to your browser view class.
>
> But maybe I'm missing what exactly you want to do.

This:

class MyView(BrowserView):
     def __call__(self):
         return aq_inner(self.context).some_template()

and make sure that IViewView is set when some_template is rendered. 
Currently that is impossible since mark_view does checks that are 
impossible to influence from the outside, and there is nothing MyView 
could set IViewView on itself.

Wichert.



-- 
Wichert Akkerman <wichert at wiggy.net>   It is simple to make things.
http://www.wiggy.net/                  It is hard to make things simple.




More information about the Framework-Team mailing list