Skip to content
Snippets Groups Projects

F delete container

Merged Henrik tom Wörden requested to merge f-delete-container into dev
1 file
+ 11
0
Compare changes
  • Side-by-side
  • Inline
@@ -2804,6 +2804,17 @@ class Container(list):
this happens, none of them will be deleted. It occurs an error
instead.
"""
chunk_size = 100
item_count = len(self)
# Split Container in 'chunk_size'-sized containers (if necessary) to avoid error 414 Request-URI Too Long
if item_count > chunk_size:
for i in range(0, int(item_count/chunk_size)+1):
chunk = Container()
for j in range(i*chunk_size, min(item_count, (i+1)*chunk_size)):
chunk.append(self[j])
if len(chunk):
chunk.delete()
return self
if len(self) == 0:
if raise_exception_on_error:
Loading