[Zope-dev] Adding a property to a batch of objects ?

Christian Scholz cs@comlounge.net
Tue, 20 Mar 2001 16:51:01 +0100


Hi!

> I wanted to do sonething like this:
> <dtml-in "objectIds(['DTML Document'])>
> <dtml-call ....manage_addProperty('foo','bar','string')>
> </dtml-in

You might want to use <dtml-in "objectValues(['DTML Document'])">
(or objectItems). then just say

<dtml-call "manage_addProperty(...)">

or you might change the ... to

<dtml-call "_.getattr(this(),_['sequence-item']).manage_addProperty(...)">

(hope this is right, have not tested it.)

First form directly builds a list of the objects instead of the
Ids, second form first looks up the id with _['sequence-item'] and
then looks up the object with that id in the local object (your folder).

Hope this helps..

-- mr topf

-- 
COM.lounge                                          http://comlounge.net/
communication & design                                 info@comlounge.net