[Zope] Quick question.
Goldthwaite, Joe
joe at goldthwaites.com
Fri Nov 21 13:37:22 EST 2003
I'm a newbie learning Python and Zope. I'm trying to create a Zope product
for my application since programming is more familiar to me than HTML. I
ran into a problem that caused me to join this list. In the process of
figuring out how to best ask the question, I found the answer.
I had created a package using the example in "The Book of Zope". When I
first restarted the server, I got an error message in the list of products
saying that my package was broken. It had an error log showing the line (a
typo) that was causing the problem. I fixed the line but restarting Zope
kept giving me the same error message on the same line that I had fixed. I
decided that something funny was going on so I deleted the package from the
"Product Management at /Control_Panel/Products" screen in the hopes that it
would be recreated or I would at least get a new error message.
The product went away completely and nothing I could do would get it back.
I tried moving it to a different directory, changing the metadata name,
changing the class names, nothing worked. I could look in the directory and
see that my __init__.pyc file was being created so I knew Zope was looking
at it but it didn't seem to do anything with it.
After working on it for most of the day, I finally found the problem. At
some point, I had accidentally deleted the "s" from the end of the
constructors' In other words, instead of this;
def initialize(context):
"""Register the EIS class"""
context.registerClass(
EIS.EIS,
constructors = (
EIS.manage_addEISForm,
EIS.manage_addEIS
),
permission = 'Add EIS',
icon='www/icon.gif'
)
I had This;
def initialize(context):
"""Register the EIS class"""
context.registerClass(
EIS.EIS,
constructor = (
EIS.manage_addEISForm,
EIS.manage_addEIS
),
permission = 'Add EIS',
icon='www/icon.gif'
)
Notice the missing "s" in "constructor =". That was doing it. Now, here's
my question, is there an error log anywhere that would have shown what was
causing the problem without searching for a needle in a haystack? I was
looking all over the place for some kind of message as to why the package
wasn't showing up but couldn't find anything. I'm assuming I just don't
know where to look.
More information about the Zope
mailing list