Skip to main content

Abstract Django models for soft removal

Project description

django-soft-remover

GitHub Actions PyPI PyPI - Python Version framework - Django PyPI - Django Version PyPI - License

Abstract Django models for soft removal

Installation

$ pip install django-soft-remover

Example of use

from django.db import models

from soft_remover.models import SoftRemovableModel, SoftRestorableModel


class ManyUniqueTogetherRem(SoftRemovableModel):
    category = models.CharField(max_length=32)
    name = models.CharField(max_length=32)
    tag = models.CharField(max_length=32)
    value = models.PositiveSmallIntegerField()

    class Meta:
        unique_together = (('category', 'name', 'remver'), ('category', 'tag', 'remver'))


class ManyUniqueTogetherRes(SoftRestorableModel):
    category = models.CharField(max_length=32)
    name = models.CharField(max_length=32)
    tag = models.CharField(max_length=32)
    value = models.PositiveSmallIntegerField()

    class Meta:
        unique_together = (('category', 'name'), ('category', 'tag'))

See more examples in test models.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-soft-remover-0.4.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

django_soft_remover-0.4.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file django-soft-remover-0.4.0.tar.gz.

File metadata

  • Download URL: django-soft-remover-0.4.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for django-soft-remover-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1891ab85f3fad3e11d0fcb0bca90ba3d15a30f8db4b23d6a248881bf78f047ea
MD5 e4faa50437e26c4d81707fab536dba37
BLAKE2b-256 9f66e1e2b3d7b6bedce76127b7dfec3d7843514c763bac21b88be7e491b2812b

See more details on using hashes here.

File details

Details for the file django_soft_remover-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_soft_remover-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 920e41ab643f632896200bfd8862c20f27cb849796bb85f5dff43611ba082f47
MD5 db39a3882d0cbce10aba551163659a24
BLAKE2b-256 541c7f2255da5365dc63a55854f54bbf9afc4c3fd7ea635e63ea6dd034c89534

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page