how to delete an object from python??
Hi there, I wonder how to delete an object from a python script. When I try oName = context.this().getId() f = context.REQUEST.PARENTS[1] f._delObject( oName ) I can not even save the script because zope complains that SyntaxError, Names starting with "_" are not allowed (_delObject). redirect to 'folder_delete' I can not use either, because it tries to call 'folder_contents' which is not possible at the point where I am. Thanks for any help Robert
Robert Rottermann writes:
I wonder how to delete an object from a python script. When I try oName = context.this().getId() f = context.REQUEST.PARENTS[1] f._delObject( oName ) I can not even save the script because zope complains that SyntaxError, Names starting with "_" are not allowed (_delObject). As a rule of thumb:
Objects starting with '_' indicate private objects; to be used only for internal tasks, usually not used from outside the class. Zope's security enforces part of this privacy.... There is an "official" method to delete object: "manage_delObjects". As the name suggests, it deletes a list (!) of objects, identified by id. Its a method of "ObjectManager". Dieter
participants (2)
-
Dieter Maurer -
Robert Rottermann