Re: [Zope] Using aquisition inside a dtml method of a product ?
Andreas Jung <andreas@andreas-jung.com> wrote:
Inside a product my index_html is set to
"index_html=HTMLFile('index_html',globals())"
The index_html.dtml calls <dtml-var standard_html_header>. This DTML method is available in the top-level hierarchy. However When I call index_html Zope complains with a KeyError/standard_html_header. When I remove the "<dtml-var standard_html_header>" call everything works fine.
Any idea why aquisition won't work in this case ?
Could it be that you don't derive your product class (directly or indirectly) from Acquisition.Implicit? Otherwise, I'm stumped. I use just the code you describe inside the PTK, for instance. Tres. -- =============================================================== Tres Seaver tseaver@digicool.com Digital Creations "Zope Dealers" http://www.zope.org
On Thu, Dec 07, 2000 at 10:07:25PM -0500, Tres Seaver wrote:
Could it be that you don't derive your product class (directly or indirectly) from Acquisition.Implicit? Otherwise, I'm stumped. I use just the code you describe inside the PTK, for instance.
Yes, that was the problem. I took the ExternalMethod product as example - this one uses explicit aquisition. Andreas
On Fri, 8 Dec 2000, Andreas Jung wrote:
On Thu, Dec 07, 2000 at 10:07:25PM -0500, Tres Seaver wrote:
Could it be that you don't derive your product class (directly or indirectly) from Acquisition.Implicit? Otherwise, I'm stumped. I use just the code you describe inside the PTK, for instance.
Yes, that was the problem. I took the ExternalMethod product as example - this one uses explicit aquisition.
Explicit can be helpful in some cases. For instance, you could add these lines to your class to solve the immediate problem without opening it up to acquire anything: standard_html = standard_html_footer = Acquisition.Acquired Tres. -- =============================================================== Tres Seaver tseaver@digicool.com Digital Creations "Zope Dealers" http://www.zope.org
participants (3)
-
Andreas Jung -
Tres Seaver -
Tres Seaver