[Zope-dev] ZCLass help

Dieter Maurer dieter@handshake.de
Sun, 5 Nov 2000 18:44:28 +0100 (CET)


Veiko Schnabel writes:
 > ....
 > i created a new Product  calles book
 > with propertys writer(string), pages(int)
 > and a standart method called index_html to output all these
 > probertys ....

 > .... instance "my_book" ....

 > <dtml-var my_book>
 > ....
 > all i get is the id of the instance my_book
 > <PubClass instance at 8ab30c8>


The ZPublisher (i.e. when you access your instance with the internet)
automatically activates "index_html" (if the object is not
callable). "dtml-var" does not. Instead, it calls the object, if
it is callable (not the case in your example), and then
converts to a string.

You can use:

    <dtml-with my_book>
       <dtml-var index_html>
    </dtml-with>


Dieter