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.2.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-soft-remover-0.2.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for django-soft-remover-0.2.1.tar.gz
Algorithm Hash digest
SHA256 524629761b810e8a16026b9b07c03f4a835f1ef4854d823598bc3cfe75dbb816
MD5 3c9aa8e261144ac1021dd7eabb178f15
BLAKE2b-256 ceb10074f09b2609628f266fde65e22c08ca0f59fa6f5d4005b2db6f1bb39ef3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_soft_remover-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for django_soft_remover-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1807e708c79f40cc74b3ccb1f548ab2490ad383df30e09f0353a7dbc83d87ed1
MD5 e51abcb450dc25ff6748510861a1b104
BLAKE2b-256 38a3f30863bdb4ac0f1a6f2d13a329cb50d10e6fee7495fbe9a752696dbaa6f8

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