Registry / database / django-soft-delete

django-soft-delete

JSON →
library1.0.23pypypi✓ verified 81d ago

Soft delete models, managers, and queryset for Django. Enables soft deletion by setting a boolean flag instead of actually removing rows. Current version 1.0.23, requires Python >=3.6. Release cadence: low activity, maintained.

pip install django-soft-delete
INSTALL
IMPORT
SIG · DJANGO-SOFT-DELETE
D
django-soft-delete
databasepythonv1.0.23
Install
3.4s avg
Import
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.23 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.4s · import 0.000s · 67MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default_app_config
from django_softdelete import default_app_config
from django_softdelete.models import SoftDeleteModel

Basic usage: inherit SoftDeleteModel, then use delete/restore/hard_delete.

from softdelete.models import SoftDeleteModel class MyModel(SoftDeleteModel): name = models.CharField(max_length=100) # Delete softly obj = MyModel.objects.create(name='test') obj.delete() # sets is_deleted = True # Hard delete obj.hard_delete() # Restore obj.restore()
Debug
Known issues
gotchaSoftDeleteModel does NOT automatically filter out soft-deleted objects in related queries. You must explicitly use .all_objects or override default manager.
fix
Use MyModel.all_objects.filter(...) to include soft-deleted items.
affects: all
gotchaThe default manager returns all objects including soft-deleted ones by default. This is opposite to many other soft-delete libraries.
fix
Override manager if needed or always call .objects.filter(is_deleted=False).
affects: all
deprecatedSoftDeleteQuerySet is deprecated; use SoftDeleteManager's queryset instead.
fix
Move queryset methods to manager.
affects: >=1.0.0
Upgrade
Version history
1.0.23latest on PyPI · released Feb 21, 2026
Audit
Dependencies
djangorequiredCore dependency
Agent activity
6 hits · last 30 days
node
6
Resources
django-soft-delete — pip install django-soft-delete · libregistry