[Zope] where are you sticking site-wide methods/resources ? ( too manyDTML-WITH's) DTML-WITH's)

Jay, Dylan djay@lucent.com
Thu, 30 Sep 1999 10:16:56 +1000


> -----Original Message-----
> From: Kevin Dangoor [mailto:kid@kendermedia.com]
> Sent: Thursday, September 30, 1999 00:42
> To: Phil Harris; zope@zope.org; chas
> Subject: Re: [Zope] where are you sticking site-wide 
> methods/resources ?
> (too manyDTML-WITH's) DTML-WITH's)
> 
> >At 08:38 AM 9/29/99 +0100, Phil Harris wrote:
> >>Couldn't you just do something like (untested)
> >>
> >><dtml-var "Imports.folder.method()">
> >
> >One of the first things I tried as I remember. Worked OK for
> >simple methods but for more complex methods :
> >
> >a) variables kept disappearing (which means I really don't grok
> >   this acquisition business yet).
> >
> >b) the DTML method could no longer 'import' other things.
> 
> Try this:
> 
> <dtml-var "Imports.folder.method(_.None, _)">
> 
> This will pass the namespace to the method, and possibly fix 
> a & b above...

I think the idea of the import tag. If you had something like
<dtml-import "imports.folder">
Then it would add it to the bottom of the namespace stack so that if
aquisition failed the name lookup would try your "imported" location. Will
this work the way I propose? Import might not be the best name? I think this
would make things a lot nicer for people and be a whole lot more intuitive
than the above.