Review Queue¶
Some companies have stricter policies for who can edit and who can publish content on their websites. The review queue app is an extension to versioning which collects commits for approval by a user with permissions.
The review_queue.change_reviewedversioncommit
permission is used to
determine who is allowed to approve commits.
To enabled the review queue,
Add
widgy.contrib.review_queue
to yourINSTALLED_APPS
.Your
WidgySite
needs to inherit fromReviewedWidgySite
.Register a subclass of
VersionCommitAdminBase
.from django.contrib import admin from widgy.contrib.review_queue.admin import VersionCommitAdminBase from widgy.contrib.review_queue.models import ReviewedVersionCommit class VersionCommitAdmin(VersionCommitAdminBase): def get_site(self): return my_site admin.site.register(ReviewedVersionCommit, VersionCommitAdmin)
If upgrading from a non-reviewed site, a
widgy.contrib.review_queue.models.ReviewedVersionCommit
object must be created for eachwidgy.models.VersionCommit
. There is a management command to do this for you. It assumes that all existing commits should be approved../manage.py populate_review_queue
-
class
admin.
VersionCommitAdminBase
¶ This an abstract
ModelAdmin
class that displays the pending changes for approval. Any it abstract, because it doesn’t know whichWidgySite
to use.-
get_site
(self)¶ The
WidgySite
that this specificVersionCommitAdminBase
needs to work on.
-
Note
The review queue’s undo (it can undo approvals) support requires Django >=
1.5 or the session-based MESSAGE_STORAGE
:
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'