I have a django app which deletes all the entries in a db and then enters another set. I am having a problem where Model.objects.all().delete() leaves objects in the database (The same entries every time).
I have fixed it using this code:
db_events = Event.objects.all()
while db_events.count():
db_events.delete()
Clearly this is not a great fix. What is going on and how can I fix it?