[Framework-Team] Re: Minutes: 8 August 2009

Hanno Schlichting hanno at hannosch.eu
Thu Aug 6 02:17:59 UTC 2009


On Thu, Aug 6, 2009 at 3:23 AM, Tres Seaver<tseaver at palladion.com> wrote:
> Alec Mitchell wrote:
>> Perhaps we could find some clever way to deprecate access to the
>> globalized attributes (e.g. make them all lazy lookups and issue a
>> warning on first access)?
>
> There is an example of this pattern in the 'ursine_globals' view on the
> CMF trunk:
>
> http://svn.zope.org/Products.CMFDefault/trunk/Products/CMFDefault/browser/ursa.py?&view=markup

Which doesn't help here. If the Plone version would be of the form
"someview_called_globals/utool" it's quite easy to do something on
attribute lookup from that "someview_called_globals" object.
Unfortunately the Plone version uses setGlobal on each and every
attribute of that globalize view. So in the template there's no
intermediate object anymore but magically "utool" is available in the
scope.

This would need some kind of very clever lazy proxy object which would
introduce a hook in between the lookup and the actual code.  Since the
TAL machinery itself checks the scope for availability of names in
some ways, that proxy couldn't just defer everything. This also gets
somewhat more complex with the two TAL implementations we have now. It
might be possible to do this, but its certainly not easy.

Hanno




More information about the Framework-Team mailing list