[Zope] Python script / python method problem

Lothar T.E.L. thatlothar@hotmail.com
Thu, 04 Jan 2001 10:47:45 -0500


Hello!

I am having a problem with one of the examples in Chapter 12 of the Zope 
book. I am creating a new product called "Zoo Exhibit" comprising of a DTML 
method, a Python script and, of course, a factory.

http://www.zope.org/Members/michel/ZB/CustomZopeObjects.html < just under 
Fig 12.2 details the example.

I have a DTML method sending "id" and "title" to a Python method/script.
I am told to create a "Python Script". I assume this is done by creating a 
"Python Method"?

This is the script I am told to create:

def add(self, container, id, title, REQUEST=None):
	"""
	Copy the exhibit template to the calling folder.
	"""
	exhibit=self.manage_clone(container.exhibitTemplate, id)
	exhibit.manage_changeProperties(title=title)
	if REQUEST is not None:
		return self.manage_main(self, REQUEST)

Should this be the entire body of the method or do the parameters need to be 
listed AGAIN in the "parameter list"?

When I add my new Zoo Exhibit product it calls the DTML method and I can 
insert the data as required but when submitted it does not do ANYTHING.

What I am asking is: Exactly what is added to the parameter list, method 
body & title of the newly created Python method?

Thanks in advance!
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com