Package: django-safedelete-E2E
Django safedeleteWhat is it ?For various reasons, you may want to avoid deleting objects from your database.This Django application provides a model mixin, that allows you to transparently retrieve or delete your objects,
without having them deleted from your database.You can choose what happens when you delete an object :it can be masked from your database (soft delete)it can be normally deleted (hard delete)it can be hard-deleted, but if its deletion would delete other objects, it will only be maskedit can be never deleted or masked from your database (no delete, use with caution)Example# Models# We create a new mixin, with the given policy : Objects will be hard-deleted, or soft deleted if other objects would have been deleted too.SafeDeleteMixin=safedelete_mixin_factory(HARD_DELETE_NOCASCADE)classArticle(SafeDeleteMixin):name=models.CharField(max_length=100)classOrder(SafeDeleteMixin):name=models.CharField(max_length=100)articles=models.ManyToManyField(Article)# Example of use>>>article1=Article(name='article1')>>>article1.save()>>>article2=Article(name='article2')>>>article2.save()>>>order=Order(name='order')>>>order.save()>>>order.articles.add(article1)# This article will be masked, but not deleted from the database as it is still referenced in an order.>>>article1.delete()# This article will be deleted from the database.>>>article2.delete()CompatibilitiesBranch 0.2.x is compatible with django >= 1.2Branch 0.3.x is compatible with django >= 1.4Current branch (0.3.x) has been tested with :Django 1.4, using python 2.6 and 2.7.Django 1.5 and 1.6, using python 2.6, 2.7 and 3.x.Django 1.7 using python 2.7 and python 3.x.Django 1.8 using python 2.7 and python 3.x.Django 1.9 using python 2.7 and python 3.x.InstallationInstalling from pypi (using pip).pip install django-safedeleteInstalling from github.pip install -e git://github.com/makinacorpus/django-safedelete.git#egg=django-safedeleteThe application doesn’t have any special requirement.DocumentationThe documentation is availablehere.LicensingPlease see the LICENSE file.ContactsPlease see the AUTHORS file.CHANGELOG0.3.6 (unreleased)** New **Add suport a Model superclass to use custom django modelsAdd an ability to set ‘db_index’ and ‘verbose_name’ for the ‘deleted’ field0.3.5** New **ChangeDELETED_VISIBLE_BY_PKtoDELETED_VISIBLE_BY_FIELDto be able to change the field used.0.3.4** New **Add aSOFT_DELETE_CASCADEpolicy which perform a SOFT_DELETE on safedelete related objectsDjango 1.8 compatibility0.3.3Prevent XSS in admin0.3.2Prevent migration errors on django 1.8 by declaring the SafeDeleteManager (internal class in managers) as global0.3.1Fix issue with release on pypi not being the good one0.3.0** New **Add aNO_DELETEpolicy which never soft or hard deletes an instanceDjango 1.8 compatibility** Removed **Support of Django 1.2 and Django 1.3 has been removed** Bugfixes **all_with_deletedmethod doesn’t lose current queryset on a related manageruniqueness is now checked against soft deleted instances tooprefetch_related() now works with SafedeleteQuerySetFix the undelete action in the administration for active objects.0.2.1 (2014-12-15)** New **Extends Django compatibility to Django 1.20.2.0 (2014-12-09)** New **Django compatilibty 1.3 => 1.7Add administration utilities