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

Andreas Zeidler az at zitc.de
Thu Aug 6 12:45:43 UTC 2009


On Aug 6, 2009, at 4:17 AM, Hanno Schlichting wrote:
> 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.

wouldn't it be possible to use @properties here?  they could issue the  
deprecation warning and return the "real global" after `setGlobal` had  
been used on them...  just brainstorming, though, i.e. i might be  
missing something essential :)


andi

--
zeidler it consulting - http://zitc.de/ - info at zitc.de
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.3rc4 released! -- http://plone.org/products/plone/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://lists.plone.org/pipermail/plone-framework-team/attachments/20090806/ddbf2dcb/attachment.sig>


More information about the Framework-Team mailing list