Tuesday, August 5, 2008

Why does Plone say "404 Not Found" when i call my tool's method?

Tool methods must have a docstring, at least if you want to call them through the web! You may have seen some docstrings in Plone that say "This method is called TTW, so it needs a docstring". Today I tried this method:

class MyTool(UniqueObject, SimpleItem, Persistent):
"""
"""
security.declarePublic('sayHello')
def sayHello(self):
"""Say something
"""
return 'Hello!'

which only started working when I remembered that line and added the docstring.

No comments: