Commit 414cedc3 authored by Jérome Perrin's avatar Jérome Perrin

use isinstance instead of type(); fix indentation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6932 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 852ef34e
...@@ -104,9 +104,9 @@ class FolderMixIn(ExtensionClass.Base, CopyContainer): ...@@ -104,9 +104,9 @@ class FolderMixIn(ExtensionClass.Base, CopyContainer):
""" delete items in this folder. """ delete items in this folder.
`id` can be a list or a string. `id` can be a list or a string.
""" """
if type(id) is type(''): if isinstance(id, str):
self._delObject(id) self._delObject(id)
elif type(id) is type([]) or type(id) is type(()): elif isinstance(id, list) or isinstance(id, tuple):
for my_id in id: for my_id in id:
self._delObject(my_id) self._delObject(my_id)
else: else:
...@@ -135,8 +135,6 @@ class FolderMixIn(ExtensionClass.Base, CopyContainer): ...@@ -135,8 +135,6 @@ class FolderMixIn(ExtensionClass.Base, CopyContainer):
my_id = 1 my_id = 1
while self.hasContent(str(my_id)): while self.hasContent(str(my_id)):
my_id = my_id + 1 my_id = my_id + 1
#LOG('_setLastId', 0, str(self))
#LOG('_setLastId', 0, str(self.aq_base))
self._setLastId(str(my_id)) # Make sure no reindexing happens self._setLastId(str(my_id)) # Make sure no reindexing happens
else: else:
my_id = self.portal_ids.generateNewId(id_group=id_group,default=default,method=method) my_id = self.portal_ids.generateNewId(id_group=id_group,default=default,method=method)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment