[Zope] calling other methods?

Kevin Dangoor kid@kendermedia.com
Sat, 15 Jan 2000 10:29:02 -0500


----- Original Message -----
From: "James Punteney" <jamesp@mmgco.com>
To: <zope@zope.org>
Sent: Friday, January 14, 2000 8:43 PM
Subject: [Zope] calling other methods?


> I have a page that inserts another page using dtml-var.  The page that is
> being inserted is up a couple of directories and then down a directory.  I
> am referencing it as:
>   <dtml-var "cds.clients.comboActive">
>
> The problem is that with the quotes it does not interpret the dtml
> statements in "comboActive" (it changes the <> to &lt; &gt;).  If I do not
> use the quotes
>   (<dtml-var cds.clients.comboActive> or  <dtml-var
/cds/clients/comboActive>)
> it comes up with this error:
> Error Type: KeyError
> Error Value: /cds/clients/comboActive

dtml-var without the quotes will look for an object with that name, so no
interpretation at all is done. That's why it can't find
cds.clients.comboActive in the case immediately above.

When you do use quotes, as in the first case at the top, then you are
basically entering a python expression. In this case, it is able to find
cds.clients.comboActive, but it is not calling it. Assuming it is a DTML
Method, here is what you should do:

<dtml-var "cds.clients.comboActive(_.None, _)">

This will actually call the method. There was another message from Michel
Pelletier within the past day or so about calling DTML Methods that talks a
little more in detail about the two parameters (the client and the
namespace). In most cases, _.None, _ is all you need to use.

Kevin