[Zope] - Understanding DTML processing

Paulo Eduardo Neves neves@inf.puc-rio.br
Fri, 22 Jan 1999 15:04:10 -0300


Hi,
I'm with a doubt about DTML processing. I'll try to create a simple
example to demonstrate it. I didn't tested it, so it can be flawed.

Suppose we have a product inside a folder:

class Product:
	def __init__(self):
		self.aName = "My Name"

	template_html = HTMLFile('template')

	def process(self, REQUEST):
	"""Process the product and return the template"""
		#process something here
		return self.template_html()

The template.dtml file should access the class attributes, something
like:
<HTML><BODY>
<!--#if aName -->
	Name: <!--#var aName -->
<!--#else -->
	There is no name
<!--#/if -->
</BODY></HTML>

I thought that calling 
http://mysite.com/folder/productId/template_html
or
http://mysite.com/folder/productId/process
would return me the same output. Although the first one shows me "Name:
My Name" and the second one shows "There is no name". 

Is this the correct behavior?
If so, what should I return from process() to make it have the same
output of template_html?

Thanks in advance,
-- 
Paulo Eduardo Neves
PUC-Rio de Janeiro 
Pager: Central: 292-4499 cod. 213 99 64
ou use a URL:  http://www.learn.fplf.org.br/neves/mensagempager.html