Skip to main content

Your project description goes here

Project description

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

This package adds the possibility of handle a moderation to django models and associated admins. This means being able to mark an entry as accepted, rejected or to be moderated (default). Querysets, Managers and Signals are included.

Documentation

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

Quickstart

Install Django Moderation Model Mixin:

pip install django-moderation-model-mixin

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'moderation_model_mixin',
    ...
)

Features

  • ModerationModelMixin

  • ModerationModelMixinAdmin

  • ModerableQuerySet

  • Actions in admin changelist

  • Signals associated to moderation action

Example of usage

# in your admin.py
class ExampleModelAdmin(ModerationModelMixinAdmin, admin.ModelAdmin):
    ...

admin.site.register(ExampleModel, ExampleModelAdmin)

# in your models.py
from moderation_model_mixin.models import ModerationModelMixin

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

Admin Interface

Here some users interface example.

First one is how the change form is shown. There are two new buttons in the submit row that allows to accept or reject entries that not yet moderated.

Not moderated instance image

This is how an accepted entry looks.

Accepted instance image

This is how a rejected entry looks.

Rejected instance image

A confirmation pop-up is shown when an acceptance or rejection request is made

Pop-up 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-12)

  • First release on PyPI.

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-moderation-model-mixin-0.1.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_moderation_model_mixin-0.1.1-py2.py3-none-any.whl (11.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-moderation-model-mixin-0.1.1.tar.gz.

File metadata

  • Download URL: django-moderation-model-mixin-0.1.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using 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.8

File hashes

Hashes for django-moderation-model-mixin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 deef1fe33adc9acae7eb9bb962231dad4f8504b306e518cca67ed61913f1175a
MD5 a21bdf1de3566c98881c32ee4cc0ce67
BLAKE2b-256 cd534d51bf54677593c752ed6e7f668691ef15f51c6da965051a128202da8862

See more details on using hashes here.

File details

Details for the file django_moderation_model_mixin-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_moderation_model_mixin-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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.8

File hashes

Hashes for django_moderation_model_mixin-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 497c77a11e68f7822261ca0803895fcd54ca8dd75f189371a21146ac6e0af43e
MD5 f365bd1c402aa6ff7c613cb17db5db67
BLAKE2b-256 46cc8aa1f33d1e005fe21631551abeb3fd53fc6db996e11a9363ca1dbb03717d

See more details on using hashes here.

Supported by

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