[Zope] manage_delObjects()

Leticia Larrosa LETICIA at tesla.cujae.edu.cu
Wed Mar 23 16:42:21 EST 2005


Thanks for all the answer but I try, for example whit:

folderToDelete = 'toDelete'
container.manage_delObjects([folderToDelete])

#or

container.manage_delObjects([container[folderToDelete].getId()])

and get the following error in both cases:
Error Type: KeyError
Error Value: toDelete

---------------------------
and the "really" traceback is:

Traceback (innermost last):
  Module ZPublisher.Publish, line 101, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 323, in _exec
  Module None, line 27, in update
   - <PythonScript at 
/approach/SiccApproach/Configuration/AuthenticationTypes/update>
   - Line 27
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec
  Module Products.PageTemplates.PageTemplate, line 96, in pt_render
   - <ZopePageTemplate at 
/approach/SiccApproach/Configuration/AuthenticationTypes/update_html>
  Module TAL.TALInterpreter, line 190, in __call__
  Module TAL.TALInterpreter, line 234, in interpret
  Module TAL.TALInterpreter, line 291, in do_startTag
  Module TAL.TALInterpreter, line 357, in attrAction_tal
  Module Products.PageTemplates.TALES, line 227, in evaluateText
  Module Products.PageTemplates.TALES, line 221, in evaluate
   - URL: 
/approach/SiccApproach/Configuration/AuthenticationTypes/update_html
   - Line 56, Column 13
   - Expression: <PythonExpr 
container[request['autType']][request['autType']+'AuthType'].function()>
   - Names:
      {'container': <Folder instance at 430bbc80>,
       'context': <Folder instance at 430bbc80>,
       'default': <Products.PageTemplates.TALES.Default instance at 
0x40aa4c6c>,
       'here': <Folder instance at 430bbc80>,
       'loop': <SafeMapping instance at 40ac2f90>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter 
instance at 0x40aa92ec>,
       'nothing': None,
       'options': {'args': (),
                   'msg': 'Usted ha tenido suerte, el servidor est\xe1 
prendido y se ha podido modificar'},
       'repeat': <SafeMapping instance at 40ac2f90>,
       'request': <HTTPRequest, 
URL=http://172.16.13.105:9673/approach/SiccApproach/Configuration/AuthenticationTypes/update>,
       'root': <application instance at 43001b30>,
       'template': <ZopePageTemplate at 
/approach/SiccApproach/Configuration/AuthenticationTypes/update_html>,
       'traverse_subpath': [],
       'user': leticia}
  Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
   - __traceback_info__: 
container[request['autType']][request['autType']+'AuthType'].function()
  Module Python expression 
"container[request['autType']][request['autType']+'AuthType'].function()", 
line 1, in <expression>
  Module AccessControl.ZopeGuards, line 67, in guarded_getitem
  Module OFS.ObjectManager, line 663, in __getitem__
KeyError: 'adminSiccDB34'


-----Original Message-----
From: Dieter Maurer <dieter at handshake.de>
To: "Leticia Larrosa" <LETICIA at tesla.cujae.edu.cu>
Cc: zope at zope.org
Date: Wed, 23 Mar 2005 20:16:15 +0100
Subject: Re: [Zope] manage_delObjects()

> Leticia Larrosa wrote at 2005-3-23 12:37 -0400:
> > ...
> >"manage_delObjects", example:
> >folderToDelete = "exampleFolder"
> >container.manage_delObjects([container[folderToDelete]])
> >#or
> >container.manage_delObjects([getattr(container, folderToDelete)])
> >----------------------------
> >I get the following error:
> >Error Type: AttributeError
> >Error Value: __getslice__
> 
> You pass in the object itself -- but you should pass its id.
> 
> Thus, the following will probably work:
> 
>       container.manage_delObjects([folderToDelete])
> 
> -- 
> Dieter
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050323/8160291b/attachment.htm


More information about the Zope mailing list