[Zope] The product I made isn't in the product management page
Allen Huang
swapp0 at yahoo.com
Tue Jan 2 22:23:23 EST 2007
I'm using Zope 2.8.8 and I trying to make my own product.
Whenever I make a product with errors in the python coding, I could see my product name registered in the product management page. But when I fix all the error, the product disappears; it not in the product management page or the add menu.
What is the problem here?
here is my coding
__init__.py--------
-------------------
import helloModule
def initialize(context):
context.registerClass(
helloModule.helloClass,
permission="Add Hello Object",
constructor=(
helloModule.manage_addHelloForm,
helloModule.manage_addHello
)
)
helloModule.py--------
------------------------
def manage_addHelloForm(self):
" Form for adding a Hello Object "
return """
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="./manage_addHello">
<input type=text name=id>
<input type=submit value="Add Hello">
</form>
</body>
</html>
"""
def manage_addHello(self):
" Method for adding a Hello Object "
newHello=helloClass(id)
self._setObject(id, newHello)
return self.manage_main(self, REQUEST)
class helloClass:
meta_type='Hello Object'
def __init__(self, name='World'):
self.name=name
def saySomething(self):
return "Hello, " + self.name
def edit(self, name):
self.name=name
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070102/f88aec95/attachment.htm
More information about the Zope
mailing list