[Zope] Struggle to call a Zclass object from another web object

Dylan Reinhardt zope@dylanreinhardt.com
Thu, 13 Mar 2003 09:02:01 -0800


At 08:43 AM 3/13/2003, pieter claassen wrote:
>This works fine for any native zope object (folder, file etc.) but for
>my custom Zclass based product, it fails.
>
>Another pointer is that when I do this
><dtml-var newster>
>
>I get the following rendition in my web page
>
><NewsManager at newster>

Ah... right.  Object methods work a little bit differently than method 
objects.  Problem here is that you're getting a reference to the method 
instead of calling it.  To call a method:

<dtml-var "method_name()">

The normal rules of acquisition apply.  Like ZMI objects, methods are 
resolved by the first object that can do the trick.  In many cases, this 
will mean including a reference to the specific instance you want to call 
this on in the URL.


>I have worked around the problem by calling the Object URL in an inline
>frame, but that is a little lame.

Yep.  When a method is referenced by URL, it is called implicitly.  When 
you reference it from DTML, you'll need to call it explicitly.

Getting warmer?

Dylan