In Zope/ZODB, how to delete objects from a BTreeFolder2

950 views Asked by At

I'm a Zope newb. I need to delete a bunch of objects from a BTreeFolder2 from say, id 1 to id 15000. When going to the admin web interface, the objects are not ordered correctly so I can't just select and delete them. The order is strictly alpha so I get:

1
10
1000
10000
10001
etc...

My guess is I will have to use zopectl -debug and issue some Python commands to select and delete those objects.

I have no idea how to do that. Can you help?

Thanks.

1

There are 1 answers

5
AudioBubble On BEST ANSWER
app.restrictedTraverse('/path/to/folder').manage_delObjects(list_of_ids)
transaction.commit()