Convenient soft-deletion support for Django models
Project description
django-livefield
About
A Django field that enables convenient soft-deletion. For Python 3.11+ and Django 4.2+
Installation
Simple: pip install django-livefield.
Example Usage
>>> from django.db import models
>>> from livefield import LiveField, LiveManager
>>>
>>>
>>> class Person(models.Model):
... name = models.CharField()
... live = LiveField()
...
... objects = LiveManager()
... all_objects = LiveManager(include_soft_deleted=True)
...
... class Meta:
... unique_together = ('name', 'live')
...
... def delete(self, using=None):
... self.live = False
... self.save(using=using)
...
>>> john = Person.objects.create(name='John Cleese')
>>> doppelganger = Person(name='John Cleese')
>>> doppelganger.save() # Raises an IntegrityError
>>> john.delete()
>>> doppelganger.save() # Succeeds!
License
MIT. See LICENSE.txt for details.
Contributing
Pull requests welcome! To save everyone some hassle, please open an issue first so we can discuss your proposed change.
In your PR, be sure to add your name to AUTHORS.md and include some tests for your spiffy new functionality. CI will green-light your build once it passes the unit tests (make test) and our linters (make lint).
Changelog
4.3.1
- Fix Changelog message
4.3.0
- Add support for Python 3.14
- Add support for Django 5.2
- Drop support for Python versions below 3.11
- Drop support for Django versions below 4.2
4.2.0
- Migrate to Poetry for building and publishing
4.1.0
- Add support for Python 3.12
- Add support for Django 5.0
4.0.0
- Add support for Python 3.8 - 3.11
- Add support for Django 4.1 and 4.2
- Remove support for old Django versions
- Remove support for old Python versions
3.3.0
- Django 3.x support
- switch to BooleanField as base (Django 4.x deprecation)
3.2.1
- Fix rST formatting in this file to pass PyPI rendering check
3.2.0 (Not released)
- Support Django 2.2
- Support Python 3.7
- Fix metadata to remove deprecated Django versions
- Expand travis tests for versions and database engines
- Remove obsolete pylint suppressions
- Thanks to @shurph for the above!
3.1.0
- Fix deprecation of context param for Field.from_db_value
- Support for Django 2.1 (Thanks @lukeburden
- Switch tests suite to use pytest
- Remove pylint-django plugin, no longer needed
3.0.0
- Add support for Python 3.6
- Add support for Django 2.0
- Remove support for Python 3.4
- Remove support for old Django versions
- Remove GIS
2.5.0 (Not released)
- Added official Python 3 support.
- Re-added support for Django 1.8. Now supports Django 1.8 and 1.9.
2.4.0 (2016-02-11)
- Drop support for Django 1.8
- Add number of affected rows for delete methods (hard_delete, soft_delete, delete). Note: Django 1.9+ only.
2.1.0 (2014-09-04)
- Add support for Django 1.7.
2.0.0 (2014-07-13)
- Renamed top-level namespace to
livefield. - Restructured internally to match Django convention.
- Added GIS support.
- Added South support.
1.0.0 (2014-02-14)
- Initial release.
- Separated existing code from main application repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_livefield-4.3.1.tar.gz.
File metadata
- Download URL: django_livefield-4.3.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fdfade110da4217493aedf41e561b9973e28405f4b83431c72d2b1eca7b89e1
|
|
| MD5 |
574aea9a011979ce2c9b64e6d75f537d
|
|
| BLAKE2b-256 |
5e37aa70ddbb2d604675d1d4ae3924e6c0f6f0e6f6fbd920c4ce0b9b4d6c391d
|
Provenance
The following attestation bundles were made for django_livefield-4.3.1.tar.gz:
Publisher:
publish.yml on hearsaycorp/django-livefield
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_livefield-4.3.1.tar.gz -
Subject digest:
9fdfade110da4217493aedf41e561b9973e28405f4b83431c72d2b1eca7b89e1 - Sigstore transparency entry: 1111149129
- Sigstore integration time:
-
Permalink:
hearsaycorp/django-livefield@ef7fc641162808add7754e9cc36c08dd07f8e05c -
Branch / Tag:
refs/heads/master - Owner: https://github.com/hearsaycorp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef7fc641162808add7754e9cc36c08dd07f8e05c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file django_livefield-4.3.1-py3-none-any.whl.
File metadata
- Download URL: django_livefield-4.3.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11bd29758c30a12afb2f3c81baf3089ec0c96aecdf3414e6357f58110a76c3c4
|
|
| MD5 |
c27f8c1847435149d4021de69ef68686
|
|
| BLAKE2b-256 |
4003c638d6675296101f83db5d424dd75e7eea3fb8e12263c266bef6c9322173
|
Provenance
The following attestation bundles were made for django_livefield-4.3.1-py3-none-any.whl:
Publisher:
publish.yml on hearsaycorp/django-livefield
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_livefield-4.3.1-py3-none-any.whl -
Subject digest:
11bd29758c30a12afb2f3c81baf3089ec0c96aecdf3414e6357f58110a76c3c4 - Sigstore transparency entry: 1111149130
- Sigstore integration time:
-
Permalink:
hearsaycorp/django-livefield@ef7fc641162808add7754e9cc36c08dd07f8e05c -
Branch / Tag:
refs/heads/master - Owner: https://github.com/hearsaycorp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef7fc641162808add7754e9cc36c08dd07f8e05c -
Trigger Event:
workflow_dispatch
-
Statement type: