django-safedelete-E2E


Namedjango-safedelete-E2E JSON
Version 0.3.6 PyPI version JSON
download
home_pagehttps://github.com/rounak-kabra/django-safedelete-e2e
SummaryMask your objects instead of deleting them from your database.
upload_time2023-08-09 09:27:10
maintainer
docs_urlNone
authorRounak Kabra
requires_python
licenseBSD
keywords django delete safedelete softdelete
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Django safedelete
=================

.. image:: https://travis-ci.org/makinacorpus/django-safedelete.png
    :target: https://travis-ci.org/makinacorpus/django-safedelete

.. image:: https://coveralls.io/repos/makinacorpus/django-safedelete/badge.png
    :target: https://coveralls.io/r/makinacorpus/django-safedelete


What 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 masked
 - it can be never deleted or masked from your database (no delete, use with caution)


Example
-------

.. code-block:: python

    # 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)

    class Article(SafeDeleteMixin):
        name = models.CharField(max_length=100)

    class Order(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()


Compatibilities
---------------

* Branch 0.2.x is compatible with django >= 1.2
* Branch 0.3.x is compatible with django >= 1.4

Current 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.



Installation
------------

Installing from pypi (using pip). ::

    pip install django-safedelete


Installing from github. ::

    pip install -e git://github.com/makinacorpus/django-safedelete.git#egg=django-safedelete


The application doesn't have any special requirement.


Documentation
-------------

The documentation is available `here <https://django-safedelete.readthedocs.io>`_.


Licensing
---------

Please see the LICENSE file.

Contacts
--------

Please see the AUTHORS file.

.. image:: https://drupal.org/files/imagecache/grid-3/Logo_slogan_300dpi.png
    :target: http://www.makina-corpus.com



=========
CHANGELOG
=========

0.3.6 (unreleased)
==================

** New **

- Add suport a Model superclass to use custom django models
- Add an ability to set 'db_index' and 'verbose_name' for the 'deleted' field

0.3.5
=====

** New **

- Change ``DELETED_VISIBLE_BY_PK`` to ``DELETED_VISIBLE_BY_FIELD`` to be able to change the field used.

0.3.4
=====

** New **

- Add a ``SOFT_DELETE_CASCADE`` policy which perform a SOFT_DELETE on safedelete related objects 
- Django 1.8 compatibility

0.3.3
=====

- Prevent XSS in admin

0.3.2
=====

- Prevent migration errors on django 1.8 by declaring the SafeDeleteManager (internal class in managers) as global

0.3.1
=====

- Fix issue with release on pypi not being the good one


0.3.0
=====

** New **

- Add a ``NO_DELETE`` policy which never soft or hard deletes an instance
- Django 1.8 compatibility

** Removed **

- Support of Django 1.2 and Django 1.3 has been removed

** Bugfixes **

- ``all_with_deleted`` method doesn't lose current queryset on a related manager
- uniqueness is now checked against soft deleted instances too
- prefetch_related() now works with SafedeleteQuerySet
- Fix the undelete action in the administration for active objects.


0.2.1 (2014-12-15)
==================

** New **

- Extends Django compatibility to Django 1.2


0.2.0 (2014-12-09)
==================

** New **

- Django compatilibty 1.3 => 1.7
- Add administration utilities

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rounak-kabra/django-safedelete-e2e",
    "name": "django-safedelete-E2E",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django,delete,safedelete,softdelete",
    "author": "Rounak Kabra",
    "author_email": "rounak.kabra@e2enetworks.com",
    "download_url": "https://files.pythonhosted.org/packages/34/83/ab823fefcdf6fbae11c85f59eb56c84d67270739126e8a4443fbdc0f19f1/django-safedelete-E2E-0.3.6.tar.gz",
    "platform": null,
    "description": "Django safedelete\n=================\n\n.. image:: https://travis-ci.org/makinacorpus/django-safedelete.png\n    :target: https://travis-ci.org/makinacorpus/django-safedelete\n\n.. image:: https://coveralls.io/repos/makinacorpus/django-safedelete/badge.png\n    :target: https://coveralls.io/r/makinacorpus/django-safedelete\n\n\nWhat is it ?\n------------\n\nFor various reasons, you may want to avoid deleting objects from your database.\n\nThis Django application provides a model mixin, that allows you to transparently retrieve or delete your objects,\nwithout having them deleted from your database.\n\nYou can choose what happens when you delete an object :\n - it can be masked from your database (soft delete)\n - it can be normally deleted (hard delete)\n - it can be hard-deleted, but if its deletion would delete other objects, it will only be masked\n - it can be never deleted or masked from your database (no delete, use with caution)\n\n\nExample\n-------\n\n.. code-block:: python\n\n    # Models\n\n    # 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.\n    SafeDeleteMixin = safedelete_mixin_factory(HARD_DELETE_NOCASCADE)\n\n    class Article(SafeDeleteMixin):\n        name = models.CharField(max_length=100)\n\n    class Order(SafeDeleteMixin):\n        name = models.CharField(max_length=100)\n        articles = models.ManyToManyField(Article)\n\n\n    # Example of use\n\n    >>> article1 = Article(name='article1')\n    >>> article1.save()\n\n    >>> article2 = Article(name='article2')\n    >>> article2.save()\n\n    >>> order = Order(name='order')\n    >>> order.save()\n    >>> order.articles.add(article1)\n\n    # This article will be masked, but not deleted from the database as it is still referenced in an order.\n    >>> article1.delete()\n\n    # This article will be deleted from the database.\n    >>> article2.delete()\n\n\nCompatibilities\n---------------\n\n* Branch 0.2.x is compatible with django >= 1.2\n* Branch 0.3.x is compatible with django >= 1.4\n\nCurrent branch (0.3.x) has been tested with :\n\n*  Django 1.4, using python 2.6 and 2.7.\n*  Django 1.5 and 1.6, using python 2.6, 2.7 and 3.x.\n*  Django 1.7 using python 2.7 and python 3.x.\n*  Django 1.8 using python 2.7 and python 3.x.\n*  Django 1.9 using python 2.7 and python 3.x.\n\n\n\nInstallation\n------------\n\nInstalling from pypi (using pip). ::\n\n    pip install django-safedelete\n\n\nInstalling from github. ::\n\n    pip install -e git://github.com/makinacorpus/django-safedelete.git#egg=django-safedelete\n\n\nThe application doesn't have any special requirement.\n\n\nDocumentation\n-------------\n\nThe documentation is available `here <https://django-safedelete.readthedocs.io>`_.\n\n\nLicensing\n---------\n\nPlease see the LICENSE file.\n\nContacts\n--------\n\nPlease see the AUTHORS file.\n\n.. image:: https://drupal.org/files/imagecache/grid-3/Logo_slogan_300dpi.png\n    :target: http://www.makina-corpus.com\n\n\n\n=========\nCHANGELOG\n=========\n\n0.3.6 (unreleased)\n==================\n\n** New **\n\n- Add suport a Model superclass to use custom django models\n- Add an ability to set 'db_index' and 'verbose_name' for the 'deleted' field\n\n0.3.5\n=====\n\n** New **\n\n- Change ``DELETED_VISIBLE_BY_PK`` to ``DELETED_VISIBLE_BY_FIELD`` to be able to change the field used.\n\n0.3.4\n=====\n\n** New **\n\n- Add a ``SOFT_DELETE_CASCADE`` policy which perform a SOFT_DELETE on safedelete related objects \n- Django 1.8 compatibility\n\n0.3.3\n=====\n\n- Prevent XSS in admin\n\n0.3.2\n=====\n\n- Prevent migration errors on django 1.8 by declaring the SafeDeleteManager (internal class in managers) as global\n\n0.3.1\n=====\n\n- Fix issue with release on pypi not being the good one\n\n\n0.3.0\n=====\n\n** New **\n\n- Add a ``NO_DELETE`` policy which never soft or hard deletes an instance\n- Django 1.8 compatibility\n\n** Removed **\n\n- Support of Django 1.2 and Django 1.3 has been removed\n\n** Bugfixes **\n\n- ``all_with_deleted`` method doesn't lose current queryset on a related manager\n- uniqueness is now checked against soft deleted instances too\n- prefetch_related() now works with SafedeleteQuerySet\n- Fix the undelete action in the administration for active objects.\n\n\n0.2.1 (2014-12-15)\n==================\n\n** New **\n\n- Extends Django compatibility to Django 1.2\n\n\n0.2.0 (2014-12-09)\n==================\n\n** New **\n\n- Django compatilibty 1.3 => 1.7\n- Add administration utilities\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Mask your objects instead of deleting them from your database.",
    "version": "0.3.6",
    "project_urls": {
        "Homepage": "https://github.com/rounak-kabra/django-safedelete-e2e"
    },
    "split_keywords": [
        "django",
        "delete",
        "safedelete",
        "softdelete"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3483ab823fefcdf6fbae11c85f59eb56c84d67270739126e8a4443fbdc0f19f1",
                "md5": "97a2ce829536de53a560b065e0eda5be",
                "sha256": "38074e90fa05150017774528ade31e8e83273226f43651dc7ebb6144b32011da"
            },
            "downloads": -1,
            "filename": "django-safedelete-E2E-0.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "97a2ce829536de53a560b065e0eda5be",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13282,
            "upload_time": "2023-08-09T09:27:10",
            "upload_time_iso_8601": "2023-08-09T09:27:10.929743Z",
            "url": "https://files.pythonhosted.org/packages/34/83/ab823fefcdf6fbae11c85f59eb56c84d67270739126e8a4443fbdc0f19f1/django-safedelete-E2E-0.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-09 09:27:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rounak-kabra",
    "github_project": "django-safedelete-e2e",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "django-safedelete-e2e"
}
        
Elapsed time: 0.13425s