[Zope] DTMLFile usage

Chris Withers chris at simplistix.co.uk
Tue Jan 20 06:28:54 EST 2004


Hi,

fowlertrainer at anonym.hu wrote:

>   When I write this:
>   class ....
>     ....
>     def index_html(self):
>         "used to view content of the object"
>         import Globals
>         df=Globals.DTMLFile('www/index',globals())
>         return df
> 
>   Zope is not rendering the result.
> 
>   When I write this:
>   class ....
>     ....
>     import Globals
>     index_html=Globals.DTMLFile('www/index',globals())

In both cases, index_html is only called once and it's result is returned to the 
browser.

Your first example would work if you did:

      def index_html(self):
          "used to view content of the object"
          import Globals
          df=Globals.DTMLFile('www/index',globals())
          return df(self)

...but your second example is "the right way"...

cheers,

Chris

BTW: Whereabouts in Hungary are you?




More information about the Zope mailing list