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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-soft-remover-0.3.1.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.3.1.tar.gz
Algorithm Hash digest
SHA256 38d409c782695683871bc0b5f8cae1935c89cce29cda4b592d05498d7d3da5c3
MD5 05ad1d16a73985f2d600f8cadc2da639
BLAKE2b-256 6fa60bfbe29fc90a1ee7f7a74f3f2977be2e9283ab2b972ce4c167325e7d83da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_soft_remover-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af0022698ae570a7d37011301cdf276f8240d67f0daf5b048ba1979250e83082
MD5 e2461bff70119d55abc6d25a22e75a6c
BLAKE2b-256 81afc934cab603a6d0ded806e8a94265e7898f388bc9fae925d401519d203837

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