[Zope] Acquisition

Marco Catunda catunda@pobox.com
12 Jun 2002 11:41:07 -0300


Hello,

	I wrote the follow python script:

from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

return request.PARENTS[0]['menu_array']


	And I have had the follow error:

Error Type: TALESError
Error Value: exceptions.KeyError on menu_array in
"standard:'here/getMenuArray | default'", at line 22, column 1

	
	It's right. The request.PARENTS[0] has no menu_array object,
	but, look the help of __getitem__(id) of objectmanager

"Returns a child object given a child id. If there is no child with the
given id, returns None. This method makes it easy to refer to children
that have id with file extensions. For example:"

	I think the help is wrong. Is it true?

	What the best way to solution it? Do I have to use try: catch:?
	Is there a function for test id, like has_key for dictionary?

Regards
-- Marco Catunda