[Zope] how add properties via Python script? /kv

Michael Bernstein webmaven at lvcm.com
Thu Nov 6 00:05:32 EST 2003


Kai Vermehr wrote:
> I'm trying to add the property "product" to all the images inside the  
> "image_folder" with this line in Python:
> 
> container.image_folder.objectValues(['Image']).manage_addProperty(produc 
> t, name, string)
> 
> but it does not work ... why? How should it be done?

What you're asking Zope to call the manage_addProperty() method on a 
list, which of course does not have any such method.

Instead, try this (untested):

for object in container.image_folder.objectValues(['Image']):
     object.manage_addProperty(product, name, string)

Cheers,

- Michael Bernstein




More information about the Zope mailing list