[Zope] DTMLFile question

Andreas Kostyrka andreas@kostyrka.priv.at
22 Aug 2002 09:11:19 +0200


Am Die, 2002-08-13 um 21.15 schrieb tomas@fabula.de:
> Now I'd like to be lazy and try to fetch the views `as needed',
> instead of declaring them as DTML class methods. Is that possible?
It is ;) That's how one usually does it with a
"ZPublisher+ZDocumentTemplate" app :)
> 
> What I have in mind is a method
> 
>   |class CMSResource( Traversable.Traversable, ...)
>   |    "Yadda, yadda"
>   |
>   |    ...
>   |
>   |    def render(name, args):
>   |      my d = DTMLFile("dtml/CMSResource/" + name)
>   |      return <<call d with appropriate arguments>>
Well, either this is not your actual code, but it lacks self, OTOH
my d seems perlish to me.
If you do something like this:
return d(...)

you will get back the rendered HTML, not a DTMLFile object.

Basically, if you'd post your real method code, we might help you.

Andreas