<HTML><BODY>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
Hi all:</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
In an python script i put the following code: </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
"container.manage_delObjects([container.exampleFolder.getId()])" where
"exampleFolder" is the </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
name of an object of type "Folder" in the "container". This code delete the
"exampleFolder" OK. </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
But when I have the name of the "Folder" that i want to delete in a variable
and call the </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
"manage_delObjects", example:</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
folderToDelete = "exampleFolder"<BR>
container.manage_delObjects([container[folderToDelete]])<BR>#or<BR>
container.manage_delObjects([getattr(container, folderToDelete)])<BR>
----------------------------<BR>I get the following error:</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
Error Type: AttributeError<BR>Error Value: __getslice__</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
-----------------------------<BR>The Traceback:<BR>Traceback (innermost
last):<BR> Module ZPublisher.Publish, line 101, in publish<BR>
Module ZPublisher.mapply, line 88, in mapply<BR> Module
ZPublisher.Publish, line 39, in call_object<BR> Module
Shared.DC.Scripts.Bindings, line 306, in __call__<BR> Module
Shared.DC.Scripts.Bindings, line 343, in _bindAndExec<BR> Module
Products.PythonScripts.PythonScript, line 323, in _exec<BR> Module
None, line 18, in update<BR> - <PythonScript at
/approach/SiccApproach/Configuration/AuthenticationTypes/update><BR>
- Line 18<BR> Module OFS.ObjectManager, line 453, in
manage_delObjects<BR> Module OFS.ObjectManager, line 241, in _getOb<BR>
AttributeError: __getslice__</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
-------------------------------</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
This appears that the "manage_delObjects" expect that somehow a non sequence
entered a property </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
expected to be a sequence.?</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
My objetives is delete a object of type "Folder" in the "container" from
this Script(Python)<BR>I use Zope2.7</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
Thanks in advance!</DIV>
</BODY></HTML>