[Zope] Accessing methods with the debugger

Oscar Picasso picasso@videotron.ca
Mon, 13 Mar 2000 12:38:00 -0500


Hi,

I have the following python Class in MyTest module:

import DocumentTemplate

class Test:
	index_html = DocumentTemplate.HTMLFile('test_form.dtml')
	
	def __init__(self):
		... 

	...

	def mymethod(self):
		return 'Hello'

In my DoTest.py module i have:
import MyTest
t=MyTest.Test()


If I run:

python /usr/local/zope/lib/python/ZPublisher/Test.py DoTest t

i get the correct output (a html file with http header).

but if I try:

python /usr/local/zope/lib/python/ZPublisher/Test.py DoTest t/mythod

i get the following error message:
***************************
Status: 404 Not Found

...

  <H2>Zope Error</H2>
  <P>Zope has encountered an error while publishing this resource.
  </P>
  <P><STRONG>Resource not found</STRONG></P>
  
  Sorry, the requested Zope resource does not exist.<p>Check the URL and try again.<p>
<!--
http://127.0.0.1/poll_test/t/mymethod
-->
...
**************************

I really don't know what is my mistake. I'm pretty sure that mymethod is a
method of the Test class. I can also access to the variable index_html of the
Test class, so why am I unable to access Test instance methods this way?

Actually, I also tried the example in the Zen HowTo: The (old) Product API
Tutorial. Is there now another way to call a python class instance method
with the debugger?