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.
The full documentation is at https://django-moderation-model-mixin.readthedocs.io.
Install Django Moderation Model Mixin:
pip install django-moderation-model-mixin
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'moderation_model_mixin',
...
)
- ModerationModelMixin
- ModerationModelMixinAdmin
- ModerableQuerySet
- Actions in admin changelist
- Signals associated to moderation action
# 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):
...
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.
This is how an accepted entry looks.
This is how a rejected entry looks.
A confirmation pop-up is shown when an acceptance or rejection request is made
Last image shows actions in the changelist.
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
pip install -r requirements_dev.txt invoke -l
Tools used in rendering this package: