renaming large list of objects
have a bunhca files that dont have extensions.. I know their extensions should be .abc so I'm trying to append this to their names... with no success :( : all 'Files' needing to be renamed to original_id + '.abc' <dtml-in "PARENTS[0].objectValues(['File'])"> <dtml-call "REQUEST.set('new_name', _.string.join(_ ['id'], '.abc') )"> <dtml-call "manage_renameObject(id, new_name ,REQUEST)"> </dtml-in> some problems I'm having is in the _.string.join ('original', '_name') suppose returns original_name but when I do the _['id'] it returns o r i g i n a l (many seperate objects) acks: my python skills are low Zope 2.1.4 install
----- Original Message ----- From: alan runyan <runyaga@myrealbox.com>
all 'Files' needing to be renamed to original_id + '.abc'
<dtml-in "PARENTS[0].objectValues(['File'])"> <dtml-call "REQUEST.set('new_name', _.string.join(_ ['id'], '.abc') )"> <dtml-call "manage_renameObject(id, new_name ,REQUEST)"> </dtml-in>
_.string.join is used to concatenate lists of strings, and the optional second argument is inserted between each pair of strings, so _.string.join('fred', 'aahz') is 'faahzraahzeaahzd' ('fred' is a list of four characters). You're better off with: <dtml-call "manage_renameObject(id, id + '.abc', REQUEST)"> Cheers, Evan @ digicool
participants (2)
-
alan runyan -
Evan Simpson