[Zope3-dev] Re: Zope3/src/zope/app/browser/skins/debug/exceptions.py:1.1

Steve Alexander steve@cat-box.net
Wed, 12 Mar 2003 17:57:49 +0200


> Actually, I'm not worried about *when* the work gets done;  I'm worried
> about *by whom*.  A component user who wants to customize the display of
> the traceback will have a much harder time doing so if the component
> hard-wires its presentation by calling a black-box Python method.

Are you saying that you'd prefer to design the view for customisation by 
subclassing, and perhaps have a formatTraceback(tb) method that could be 
easily overridden?


> This particular case is tricky, because we *don't* want to keep the
> actual traceback object around for any length of time.

It should only be kept around for the duration of the request. Your try: 
finally: should ensure circular references are broken.

I feel like I'm missing your point... :-/  If it looks that way, please 
put me right.


> FWIW, in other work, I do find it a pattern that I will do lots of
> adapter lookup in the __init__ of the view class, in order to make the
> adapted content object easily available to the template.

That could make certain things unnecessarily slow.
In this case, it would be better to look up the adapters in the method 
that gets called before a template is rendered. (Which doesn't yet exist.)

--
Steve Alexander