{"id":37078686,"url":"https://github.com/yucealiosman/soft-delete","last_synced_at":"2026-01-14T09:12:40.208Z","repository":{"id":57469159,"uuid":"381636414","full_name":"yucealiosman/soft-delete","owner":"yucealiosman","description":"This Django application provides an abstract model, that allows you to transparently retrieve or delete your objects, without having them deleted from your database.","archived":false,"fork":false,"pushed_at":"2021-09-17T11:34:05.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T17:27:09.214Z","etag":null,"topics":["django","python","soft-delete"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yucealiosman.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-30T08:54:21.000Z","updated_at":"2021-09-17T11:34:08.000Z","dependencies_parsed_at":"2022-09-19T14:52:17.140Z","dependency_job_id":null,"html_url":"https://github.com/yucealiosman/soft-delete","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yucealiosman/soft-delete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yucealiosman%2Fsoft-delete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yucealiosman%2Fsoft-delete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yucealiosman%2Fsoft-delete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yucealiosman%2Fsoft-delete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yucealiosman","download_url":"https://codeload.github.com/yucealiosman/soft-delete/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yucealiosman%2Fsoft-delete/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","python","soft-delete"],"created_at":"2026-01-14T09:12:39.769Z","updated_at":"2026-01-14T09:12:40.202Z","avatar_url":"https://github.com/yucealiosman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**This package provides an abstract django model, that allows you to transparently retrieve or delete your objects, without having them deleted from your database.**\n\n### Example of usage\n\n#### imports\n```python\nfrom django_soft_delete.models import SoftDeletionModel\n\n```\n\n#### Create a new model class derived from SoftDeletionModel.\n```python\nclass User(SoftDeletionModel):\n    name = models.CharField(max_length=100)\n```\n\n\n#### And just invoke delete method, that's all.\n\n```python\nuser = User(name='test')\nuser.save()\nuser.delete()\n```\n##### You can use all functionalities with queryset as well.\n\n```python\nusers = User.objects.filter(name='test')\nusers.delete()\n```\n\n##### This user will be masked, but not deleted from the database.\n\n```python\nUser.object.filter(name='test') #returns empty query string.\n\nUser.all_objects.filter(name='test) #returns deleted user instance which has non empty deleted_at field.\n```\n\n\n\n##### In order to create model deletion relations, you have to import deletion.py and use the related on_delete functions like CASCADE, PROTECT, etc.\n```python\nfrom django_soft_delete.deletion import CASCADE\nfrom django_soft_delete.models import SoftDeletionModel\n\nclass User(SoftDeletionModel):\n    name = models.CharField(max_length=100)\n    \n    \nclass Profile(SoftDeletionModel):\n    name = models.CharField(max_length=100)\n    user = models.ForeignKey(User, on_delete=CASCADE,\n                             verbose_name=_('User'), null=True,\n                             blank=True)\n```\n##### In order to revive your soft-deleted records, you can use undelete method.\n```python\nuser = User(name='test')\nuser.save()\nuser.delete()\nuser.undelete()\n```\n\n##### In order to delete your instance permanently from your database, you can use hard_delete method.\n\n```python\nuser = User(name='test')\nuser.save()\nuser.hard_delete()\n```\n\n## Installation\n- pip install soft-django-delete\n\n##### Add 'django_soft_delete' in your INSTALLED_APPS:\n\n```python\nINSTALLED_APPS = [\n    'django_soft_delete',\n    [...]\n]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyucealiosman%2Fsoft-delete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyucealiosman%2Fsoft-delete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyucealiosman%2Fsoft-delete/lists"}