Forum moderation¶
The forum_moderation application provides moderation views allowing moderators to move, close or
delete forum topics or posts. It also provides access to the moderation queue used to approve or
reject posts awaiting approval.
Views¶
Forum moderation views¶
This module defines views provided by the forum_moderation application.
- class machina.apps.forum_moderation.views.ModerationQueueDetailView(**kwargs)¶
Bases:
PermissionRequiredMixin,DetailViewDisplays the details of an item in the moderation queue.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- model¶
alias of
Post
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- class machina.apps.forum_moderation.views.ModerationQueueListView(**kwargs)¶
Bases:
PermissionRequiredMixin,ListViewDisplays the moderation queue.
- get_queryset()¶
Returns the list of items for this view.
- model¶
alias of
Post
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- class machina.apps.forum_moderation.views.PostApproveView(**kwargs)¶
Bases:
PermissionRequiredMixin,SingleObjectTemplateResponseMixin,BaseDetailViewProvides the ability to approve queued forum posts.
- approve(request, *args, **kwargs)¶
Approves the considered post and retirects the user to the success URL.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- get_success_url()¶
Returns the success URL to redirect the user to.
- model¶
alias of
Post
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- post(request, *args, **kwargs)¶
Handles POST requests.
- class machina.apps.forum_moderation.views.PostDisapproveView(**kwargs)¶
Bases:
PermissionRequiredMixin,SingleObjectTemplateResponseMixin,BaseDetailViewProvides the ability to disapprove queued forum posts.
- disapprove(request, *args, **kwargs)¶
Disapproves the considered post and retirects the user to the success URL.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- get_success_url()¶
Returns the success URL to redirect the user to.
- model¶
alias of
Post
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- post(request, *args, **kwargs)¶
Handles POST requests.
- class machina.apps.forum_moderation.views.TopicDeleteView(*args, **kwargs)¶
Bases:
PermissionRequiredMixin,DeleteViewProvides the ability to delete forum topics.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- get_success_url()¶
Returns the success URL to redirect the user to.
- model¶
alias of
Topic
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- class machina.apps.forum_moderation.views.TopicLockView(**kwargs)¶
Bases:
PermissionRequiredMixin,SingleObjectTemplateResponseMixin,BaseDetailViewProvides the ability to lock forum topics.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- get_success_url()¶
Returns the success URL to redirect the user to.
- lock(request, *args, **kwargs)¶
Locks the considered topic and retirects the user to the success URL.
- model¶
alias of
Topic
- perform_permissions_check(user, obj, perms)¶
Performs the permission check.
- post(request, *args, **kwargs)¶
Handles POST requests.
- class machina.apps.forum_moderation.views.TopicMoveView(**kwargs)¶
Bases:
PermissionRequiredMixin,SingleObjectTemplateResponseMixin,FormMixin,SingleObjectMixin,ProcessFormViewProvides the ability to move forum topics.
- form_class¶
alias of
TopicMoveForm
- form_valid(form)¶
Handles a valid form.
- get(request, *args, **kwargs)¶
Handles GET requests.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- get_form_kwargs()¶
Returns the keyword arguments used to initialize the associated form.
- get_success_url()¶
Returns the success URL to redirect the user to.
- model¶
alias of
Topic
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- post(request, *args, **kwargs)¶
Handles POST requests.
- class machina.apps.forum_moderation.views.TopicUnlockView(**kwargs)¶
Bases:
PermissionRequiredMixin,SingleObjectTemplateResponseMixin,BaseDetailViewProvides the ability to unlock forum topics.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- get_success_url()¶
Returns the success URL to redirect the user to.
- model¶
alias of
Topic
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- post(request, *args, **kwargs)¶
Handles POST requests.
- unlock(request, *args, **kwargs)¶
Unlocks the considered topic and retirects the user to the success URL.
- class machina.apps.forum_moderation.views.TopicUpdateToAnnounceView(**kwargs)¶
Bases:
TopicUpdateTypeBaseViewProvides the ability to switch a topic to an announce.
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- class machina.apps.forum_moderation.views.TopicUpdateToNormalTopicView(**kwargs)¶
Bases:
TopicUpdateTypeBaseViewProvides the ability to switch a topic to a normal topic.
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- class machina.apps.forum_moderation.views.TopicUpdateToStickyTopicView(**kwargs)¶
Bases:
TopicUpdateTypeBaseViewProvides the ability to switch a topic to a sticky topic.
- perform_permissions_check(user, obj, perms)¶
Performs the permissions check.
- class machina.apps.forum_moderation.views.TopicUpdateTypeBaseView(**kwargs)¶
Bases:
PermissionRequiredMixin,SingleObjectTemplateResponseMixin,BaseDetailViewProvides the ability to change the type of forum topics: normal, sticky topic or announce.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_controlled_object()¶
Returns the controlled object.
- get_success_url()¶
Returns the success URL to redirect the user to.
- model¶
alias of
Topic
- post(request, *args, **kwargs)¶
Handles POST requests.
- update_type(request, *args, **kwargs)¶
Updates the type of the considered topic and retirects the user to the success URL.