[Zope-CMF] Re: DynamicType's __before_publishing_traverse__

yuppie y.2004_ at wcm-solutions.de
Fri Mar 5 04:06:24 EST 2004


Chris McDonough wrote:
> This code in PortalContent still exists, but I can't think of a case
> where it ever gets invoked:
>    def __call__(self):
>         '''
>         Invokes the default view.
>         '''
>         view = _getViewFor(self)
>         if getattr(aq_base(view), 'isDocTemp', 0):
>             return view(self, self.REQUEST)
>         else:
>             return view()
>     index_html = None  # This special value informs ZPublisher to use
> __call__
> It is sort of misleading to leave this code around, I think.  Can anyone
> think of a case where it gets used anymore?  If so, then why have the
> __before_publishing_traverse__ too?

I hope it is save to remove this code ( and _getViewFor() and view() ). 
This code wasn't removed for now because I'm not sure about potential 
backwards compatibility issues with third party products. The new 
machinery bypasses this old code completely, so the fact it is 
'misleading' to leave this code around is the only problem.

Maybe we should add a deprecation warning?


More information about the Zope-CMF mailing list