Convenient soft-deletion support for Django models
Project description
django-livefield
About
A Django field that enables convenient soft-deletion.
Example Usage
>>> from django.db import models
>>> from django_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')
...
>>> john = Person.objects.create(name='John Cleese')
>>> doppelganger = Person(name='John Cleese')
>>> doppelganger.save() # Raises an IntegrityError
>>> john.delete()
>>> doppelganger.save() # Succeeds!
Changelog
1.0.0 (2014-02-14)
Initial release.
Separated existing code from main application repository.
Developed and maintained by Hearsay Social, Inc..
Contributors
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
django-livefield-1.0.0.tar.gz
(3.9 kB
view hashes)