[Zope] Return values for html display?

Michel Pelletier michel@digicool.com
Mon, 6 Dec 1999 17:29:26 -0500


> -----Original Message-----
> From: jiva@devware.com [mailto:jiva@devware.com]
> Sent: Sunday, December 05, 1999 1:32 AM
> To: zope@zope.org
> Subject: [Zope] Return values for html display?
> 
> 
> So, I have set up some external methods that do some stuff, and I
> ultimately want to display html from them.  However, I find the only
> way I can do this is to return it from my function.  print() seems
> only to send it to the zserver log. 

Actually, it writes it to stdout, which end up in the logs.

> Soooo, my question is, is this by
> design?

Yes.

> Is there some way to get print() to actually shoot html to
> the page the end user sees?

Probably not.

> Is there a reason I wouldn't want to do
> this?

No, it's quite useful.  What you're looking for is RESPONSE.write().
Note, error's don't get sent to the browser in their usualy nicely
formated way if you use RESPONSE.write().  Everything else works the
same however (ie, the transaction gets aborted, the exception can be
caught by a <dtml-try> etc..)

-Michel