[Zope] using a DTMLFile in a python product method

Matthew Wilbert mwilbert@alum.mit.edu
Wed, 20 Jun 2001 13:23:02 -0700


Casey,
=2E
Thanks for the quick response.

I tried calling it using apply, but I couldn't get the call right.  It lo=
oked like other code called something like

apply(DTMLFile(file,globals()),(),kw)

but I don't know what arguments it needs--if it works
without arguments, I don't think I tried that.

Anyway, if that's the correct approach, I'll play around
with it some more until I get it to work.

Thanks again,

Matt Wilbert
mwilbert@alum.mit.edu

-----Original Message-----
From:    Casey Duncan cduncan@kaivo.com
Sent:    Wed, 20 Jun 2001 10:20:32 -0600
To:      mwilbert@alum.mit.edu
CC:      zope@zope.org
Subject: Re: [Zope] using a DTMLFile in a python product method


Matthew Wilbert wrote:
>=20
> I have a method in a python product where I return different
> forms based upon a REQUEST parameter.  If I construct the returned html=
 as a python string and return it, it works fine.  But it seems more sens=
ible to save the html as a template and then return that.  So I created a=
 template file, and used it to create a DTMLFile instance.  The problem i=
s that if I return this instance, it is returned html-quoted, which isn't=
 what I want.  Looking at the code, I can see this is the expected behavi=
or if you convert it to string, but that isn't being done, explicitly.at =
least.
>=20
> Anyone know how to get it to show up unquoted?
>=20
> Matt Wilbert
> mwilbert@alum.mit.edu

It would seem you are returning the DTMLFile object itself. I would
suggest returning the rendered result of the object instead by calling
it and returning the resulting data.

--=20
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>



_________________________________________________________________________=
__
Visit http://www.visto.com/info, your free web-based communications cente=
r.
Visto.com. Life on the Dot.