Hi, 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. Any suggestions ? I would be sooo hapyy, since I have to add three props to about 1200 DTML Documents :-( - Holger ----------------------------------- catWorkX GmbH Hamburg Dipl.-Ing. Holger Lehmann Stresemannstr. 364 22761 Hamburg Tel : +49 40 890 646-0 Info: 0700 catWorkX ( 0700 22 89 67 59 ) Fax : +49 40 890 646-66 mailto:lehmann@catworkx.de http://www.catworkx.de http://www.catbridge.de
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
Thanks, <dtml-call "_.getattr(this(),_['sequence-item']).manage_addProperty(...)"> worked just like a beauty. I thought I tried that one, but I must have made a mistake :-) - Holger ----------------------------------- catWorkX GmbH Hamburg Dipl.-Ing. Holger Lehmann Stresemannstr. 364 22761 Hamburg Tel : +49 40 890 646-0 Info: 0700 catWorkX ( 0700 22 89 67 59 ) Fax : +49 40 890 646-66 mailto:lehmann@catworkx.de http://www.catworkx.de http://www.catbridge.de On Tue, 20 Mar 2001, Christian Scholz wrote:
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
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
participants (3)
-
cs@comlounge.net -
Holger Lehmann -
R. David Murray