[Zope] Method invocation.

Antonio Costa anjc@fct.unl.pt
Tue, 06 Mar 2001 10:41:19 +0000


This is a multi-part message in MIME format.
--------------0FCBD795A66219CE28E5CE35
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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  ##
                    #          ##
                   ##           ##
                   ###          ###
                 +++#####       ##++
                ++++++#       #++++++
                +++++++#     #+++++++
                  +++++#######+++++
                    +++       +++
--------------0FCBD795A66219CE28E5CE35
Content-Type: text/x-vcard; charset=us-ascii;
 name="anjc.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Antonio Costa
Content-Disposition: attachment;
 filename="anjc.vcf"

begin:vcard 
n:Costa;Antonio
tel;cell:+351933302511
x-mozilla-html:FALSE
url:http://www.terravista.pt/Enseada/1831
org:Faculdade de Ciencias e Tecnologia;SI
adr:;;;;;;
version:2.1
email;internet:anjc@fct.unl.pt
x-mozilla-cpt:;0
fn:Antonio Costa
end:vcard

--------------0FCBD795A66219CE28E5CE35--