[Zope] explicit object reference without acquisition

J Cameron Cooper jccooper at jcameroncooper.com
Tue Oct 7 20:48:23 EDT 2003


>  I would like to call an Zope object (and pass variables to it) located
>in a folder that is not reachable by acquisition from a DTML method.
>When I tried the following it failed:
>   E.g.
>    If I have a dtml method in the folder "/a/b" called index_html.
>Inside of this dtml method I have the following statement
>
>   <dtml-var expr="c.d.e.(var1='var1')">
>
> The Zope folder object "/c/d/e" exists and has a DTML method inside it
>called index_html that references the variable var1.
> When I try to evaluate the above expression, I get the following error:
>
> Error Type: AttributeError
>Error Value: __call__
>
> What am I doing wrong? I would like to make use of objects inside of
>Zope that are not reachable by acquisition via the <dtml-var>' or
><dtml-call>' methods.
>  
>
You're trying to call a folder, which does not work, as it has nothing 
to render (it has no '__call__' method). If you say::

<dtml-var "c.d.e.index_html(var1='hey')">

it works fine. The 'index_html' magic is not used in a call like that.

          --jcc

-- 
"Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design."
(http://www.devx.com/java/editorial/15511)





More information about the Zope mailing list