[Zope3-Users] zopectl debug and deleting objects
Justin Fletcher
justin at opensoft.ws
Thu Dec 13 06:45:53 EST 2007
Hello all,
I am using 'zopectl debug' to run a script that imports data into the
ZODB. This part is working fine. However, while testing this import
script, I like to delete all the objects I have created so I can test
the script again. I have been deleting the objects like this:
for i in root['mysite'].keys():
del(root['mysite'][i])
The problem is that this will not delete all the objects. It only
deletes a portion of them each time I run it, so I must run the loop
multiple times before it will delete everything. I make no changes to
it, I just have to run the loop 4 or 5 times before root['mysite'] will
be empty.
I have also tried:
for i in root['mysite'].keys():
root['mysite'].__delitem__(i)
which has the same result. Why will it not delete all the items?
Should I be deleting these objects in a different way?
I am using the previous release of grokproject (not the current one),
but I don't think this problem is specific to that. Please point me in
the right direction if this list is not the appropriate place to ask.
Many thanks,
-Justin
More information about the Zope3-users
mailing list