[Zope] Acquisition from a DTML method in a subdirectory

Jim Anderson ezjab at ieee.org
Sun Mar 7 13:57:48 EST 2004


I'm running Zope 2.7.0 on a windows platform and
I have a DTML method referenced in a subdirtory
from a DTML document object. I want to run
and external method from the DTML method, but
Zpublisher is giving me an error message that
the external method resource is causing
a name error and the external method is not
defined.

My ZMI structure looks like this:

  root
    |
    A
      |
      Adtml_doc
      Aext_method
      B
        |
        Bdtml_method

Adtml_doc has the following code:

    <dtml-var expr="B.Bdtml_method()">

Bdtml_method has code that calls Aext_method
in A:

    Hi!
    <dtml-var expr="Aext_method()">
    Bye!


If I run the 'view' tab for Bdtml_method, the method
runs as expected and if I assume that the method returns
'Good', my output is:

    Hi!
    Good
    Bye!

If I run Adtml_doc, I then get the error
message that Aext_method
is not defined. If I place a copy of Aext_method
in the B, and run Adtml_doc, I still
get an error message.

I was expecting that the Bdtml_method would find
Aext_method by aquiring it from the A, but
this does not seem to be the case.

So it seems that calling a dtml method in a subdirectory
does not acquire from the subdirectory or the current
directory? Can anyone explain this?

More importantly what is the proper way to call
an external method from a dtml method being
referenced in a subdirectory?


Jim Anderson













More information about the Zope mailing list