A cautionary tail of adding soft delete to Models

I once had the chance to start a new project and codebase in one of my jobs. A fresh Django codebase from scratch that was going to be an API for a mobile app. As a result myself & the other developer decided to implement an abstract BaseModel with a few handy fields and some common functionality. This functionality included the soft-delete mixins and managers from django-model-utils.

Years later when this codebase had been in production for a while, a new colleague was debugging some issue and found that the soft-delete was causing a host of issues which prompted him to submit this issue Do have a read because it's a good warning when interacting with Django's default manager.

But long story short, if you do need some sort of soft-delete functionality in your codebase, then consider the inverse like a field called is_available over is_deleted and add extra managers (eg available_objects) instead of overriding the default