[Fixed]-Soft deleting objects in django


django-softdelete is a library implementing soft delete for Django, with cascading. It also stores the changesets, and allows reverting the deletions (e.g. reverting the whole cascade).

I’m not sure what is it’s maintenance status and quality, but it can at least serve as inspiration, if not a solution by itself.



Maybe you can use django-paranoid.

It is similar to acts_as_paranoid for rails and is easy to use.

You only need to extend your model with ParanoidModel.

To retrieve the deleted object, you use the objects_with_deleted manager:


and if you want to perform a hard delete on an object, use the True parameter:

m = MyModel.objects.last()

Leave a comment