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

Uploaded Source

Built Distribution

django_soft_remover-0.3.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-soft-remover-0.3.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.1

File hashes

Hashes for django-soft-remover-0.3.0.tar.gz
Algorithm Hash digest
SHA256 963eb3bc8e07273572cd846d3754a32bcf513e1702129ee30f935e7a6aff46ab
MD5 2e0689fb8766038daf49a46e7484abab
BLAKE2b-256 0fd9cc7e1fd6b86bf80e9d43b9f428b337e001abea9773c03817451b9f00510b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_soft_remover-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9819b57fea28ca71a0a92fe63377ae8e2092083db2d9f37aac4fba4eda4c2728
MD5 831de272fb1c5fa228af030fb9fe3cf5
BLAKE2b-256 3f19ca215324bc0e1e3bc420c37407c2fb6e6df7e951a7ce3412d27afe8589cf

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