First of all I'd like to thank you for all your help. I've strugling with this for almost a week. What I'm trying to do: Directory structure Products/SearchObject/__init__.py /SearchObject.pt File __init__.py __doc__ = """ Search Object Product """ __version__ = '0.1' import SearchObject def initialize(context): """Initialize the Search Object product This makes de product appear on the product list""" global SearchObject import SearchObject context.registerClass( SearchObject.SearchObject, constructors = ( SearchObject.manage_prevAddSearchObject, SearchObject.manage_addSearchObjectForm, SearchObject.manage_addSearchObject), ) File SearchObject.py: manage_addSearchObjectForm = DTMLFile('dtml/searchObjectManage', globals()) def manage_prevAddSearchObject(self): "Criacao de um objecto SearchObject" # print 'Ola' + str(self) # global manage_addSearchObjectForm ##### Desperate attempt ##### # import SearchObject ##### Another one ##### return manage_addSearchObjectForm() ##### Error in this line. ##### def manage_addSearchObject(self, ... In some words I want to make some computation before calling the DTML form.
2: The problem I'm having several times is that from that method I'm having trouble to call another one, if this other is a DTMLFile(). I have no problem calling another method defined by def. What happens? What trouble do you have?
Error Type: AttributeError Error Value: aq_parent ... File /home/anjc/Zope-2.3.0-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py, line 290, in _getContext (Object: searchObjectManage) AttributeError: (see above)
What I don't know: How to debug a situation like this. I'm having another problem with method invocation a little bit like this and I can't debug it. I think my problem has to do with the environment but I'm not sure and I don't know how to figure it out. There is the "ZPublisher/Test.py" script. I use it regularly together with "pdb" (the Python debugger) to analyse complex problems. It allows you to emulate HTTP request from the command line and to debug the execution with "pdb".
Initialization problems often do not need real debugging. Many problems in this phase lead to a broken product. In this case, the corresponding product in "Control_Panel->Product Management" has a traceback object that shows where the problem occured.
For unknown reasons, some problems in this phase show not up in a broken product (the product is left unchanged but is not working). Many of these can be analysed (and solved) by enabling Zope's logging facility: define STUPID_LOG_FILE as a filename (argument to "start"). Such problems are then logged to the log file and can be analysed.
I don't think this is the case.
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- URL: http://www.terravista.pt/Enseada/1831 http://accosta.planetaclix.pt PT is Portugal ####### # # # #" #" # Linux ##vvvvv## Rules! ## vvv ## # ## ## ## ### ### +++##### ##++ ++++++# #++++++ +++++++# #+++++++ +++++#######+++++ +++ +++