Skip to main content

Django Activation Model Mixin

https://badge.fury.io/py/django-activation-model-mixin.svg/?style=flat-square https://readthedocs.org/projects/pip/badge/?version=latest&style=flat-square Coverage Status

This package allows to quickly add an activation/deactivation logic to django models and associated admins. This means being able to mark an entry as active or inactive, saving the interaction time. Querysets, Managers and Signals are included.

Documentation

The full documentation is at https://django-activation-model-mixin.readthedocs.io.

Quickstart

Install Django Activation Model Mixin:

pip install django-activation-model-mixin

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'activation_model_mixin',
    ...
)

Features

  • ActivationModelMixin

  • ActivationModelMixinAdmin

  • ActivationQuerySet

  • Actions in admin changelist

  • Signals associated to activation action

Example of usage

# in your admin.py
from activation_model_mixin.admin import ActivationModelMixinAdmin
class ExampleModelAdmin(ActivationModelMixinAdmin, admin.ModelAdmin):
    ...

admin.site.register(ExampleModel, ExampleModelAdmin)

# in your models.py
from activation_model_mixin.models import ActivationModelMixin

class ExampleModel(ActivationModelMixin, models.Model):
    ...

Admin Interface

Here some users interface example.

First one is how the change form is shown. There is a new button in the submit row that allows to activate/deactivate one entry.

Not moderated instance image

This is how an accepted entry looks.

Accepted instance image

This is how a rejected entry looks.

Rejected instance image

Last image shows actions in the changelist.

Actions image

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Development commands

pip install -r requirements_dev.txt
invoke -l

Credits

Tools used in rendering this package:

History

0.1.0 (2021-11-15)

  • First release on PyPI.

Metadata

Release files for django-activation-model-mixin 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-activation-model-mixin 0.1.0
File Size Uploaded Provenance Actions
django-activation-model-mixin-0.1.0.tar.gz 12.5 kB Without provenance Details for django-activation-model-mixin-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-activation-model-mixin 0.1.0
File Interpreter ABI Platform Actions
django_activation_model_mixin-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for django_activation_model_mixin-0.1.0-py2.py3-none-any.whl

Total release size: 22.6 kB

Release files / django-activation-model-mixin-0.1.0.tar.gz

Download URL django-activation-model-mixin-0.1.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e4135fc13ce24ee5e62dafad1aab4c1558a92d5c57c5d3b86b980a014330a653
BLAKE2b-256 checksum
How to use checksums
c4c932f10f06522175b0f944f168f1c8a197854ca4c1ea8c8a2247c4dbfa7a99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / django_activation_model_mixin-0.1.0-py2.py3-none-any.whl

Download URL django_activation_model_mixin-0.1.0-py2.py3-none-any.whl
Size 10.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
32f42a2c6641629cea9802291b38f4941a7887a83fbc9bf165d6edad4ecda1b2
BLAKE2b-256 checksum
How to use checksums
45b767dbb7a3899cd0defb8901014a5f23875508d4c806064c4f92f9b930e0ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Security for django-activation-model-mixin 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page