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

R. David Murray bitz@bitdance.com
Tue, 20 Mar 2001 10:56:02 -0500 (EST)


On Tue, 20 Mar 2001, Holger Lehmann wrote:
> I wanted to do sonething like this:
> <dtml-in "objectIds(['DTML Document'])>
> <dtml-call ....manage_addProperty('foo','bar','string')>
> </dtml-in
> 
> But I am missing the .... part :-(
> I can happily add the property to myself or the folder above (if a DTML
> Method is used) but I just cant seem to be able to add the property to an
> object I want.

I would have thought that this would work.

<dtml-call "_.getitem('sequence-item',0).manage_addProperty('foo','bar','string')">

ought to.  Or, if they are zclass instances, .propertysheets.<yoursheet>.manage_addProperty...

Of course, I'm saying this without testing anything, so caveat emptor.

This would be a good thing to do in a pythonscript rather than a dtml method,
by the way.


--RDM