[Zope] adding objects to a ZCatalog

Jonathan dev101 at magma.ca
Fri Feb 23 13:14:50 EST 2007


----- Original Message ----- 
From: "Tom Von Lahndorff" <tom at modscape.com>
To: "Peter Bengtsson" <peter at fry-it.com>
Cc: <zope at zope.org>
Sent: Friday, February 23, 2007 1:12 PM
Subject: Re: [Zope] adding objects to a ZCatalog
> Peter Bengtsson wrote:
>> On 2/23/07, Tom Von Lahndorff <tom at modscape.com> wrote:
>>> Hi,
>>>
>>> I have a folder called "images" and a form that to add images to that
>>> folder. The form called an external method (../images/addImage) that
>>> references a python script, the one I sent earlier, that creates 4
>>> versions of the images in 4 sizes and places them in the "images"
>>> folder. Also in the "images" folder I have a ZCatalog called
>>> "ImageData". I'm trying to add a line to the python script to
>>> automatically catalog any images that are added to the "images" folder.
>>> I tried "ImageData.manage_catalogObject..." but I kept getting back:
>>> NameError: global name 'ImageData' is not defined. Any advice? Thanks.
>>>
>> Perhaps you meant
>> context.ImageData.manage_catalogObject(...
>>
> returns: "NameError: global name 'context' is not defined"

You are either (1) doing this in an external method, in which case use 
'self' instead of 'context', or (2) the bindings in your python script are 
pooched (click on the bindings tab of the python script, the 'Context' 
binding should be set to 'context').

Jonathan 



More information about the Zope mailing list