[Zope-dev] exception views lost context on Zope 2.12

Wichert Akkerman wichert at wiggy.net
Tue Feb 23 07:36:43 EST 2010


On 2/23/10 13:22 , Martin Aspeli wrote:
> Wichert Akkerman wrote:
>
>> It is not useful, it is critical. Without the context you can not use
>> any browser views for example.
>
> Well, the use cases that have been to date have done without it. :) I'm
> not disagreeing with you, I'm just saying we need to make sure we don't
> break existing use cases (plone.app.linkintegrity, plone.caching to name
> two that I know of).

As I said plone.app.linkintegrity always used this trick in Zope 2.10, 
so it is not something I just came up with. It is known to work :)

>> In a Plone context that means you can not
>> render any Plone template. The trick plone.app.linkintegrity did was to
>> wrap the exception view in the context, which both keeps the
>> API the same and provides the context.
>
> Makes sense, although it means __parent__ is not self.context, which may
> be a bit unusual.

I am not aware of a requirement that they have to be the same.

Wichert.


More information about the Zope-Dev mailing list