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:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.detail.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
machina.core.db.models.Post
-
perform_permissions_check(user, obj, perms)¶ Performs the permissions check.
-
-
class
machina.apps.forum_moderation.views.ModerationQueueListView(**kwargs)¶ Bases:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.list.ListViewDisplays the moderation queue.
-
get_queryset()¶ Returns the list of items for this view.
-
model¶ alias of
machina.core.db.models.Post
-
perform_permissions_check(user, obj, perms)¶ Performs the permissions check.
-
-
class
machina.apps.forum_moderation.views.PostApproveView(**kwargs)¶ Bases:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.detail.SingleObjectTemplateResponseMixin,django.views.generic.detail.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
machina.core.db.models.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:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.detail.SingleObjectTemplateResponseMixin,django.views.generic.detail.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
machina.core.db.models.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(**kwargs)¶ Bases:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.edit.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
tests._testsite.apps.forum_conversation.models.Topic
-
perform_permissions_check(user, obj, perms)¶ Performs the permissions check.
-
-
class
machina.apps.forum_moderation.views.TopicLockView(**kwargs)¶ Bases:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.detail.SingleObjectTemplateResponseMixin,django.views.generic.detail.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
tests._testsite.apps.forum_conversation.models.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:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.detail.SingleObjectTemplateResponseMixin,django.views.generic.edit.FormMixin,django.views.generic.detail.SingleObjectMixin,django.views.generic.edit.ProcessFormViewProvides the ability to move forum topics.
-
form_class¶ alias of
machina.apps.forum_moderation.forms.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
tests._testsite.apps.forum_conversation.models.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:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.detail.SingleObjectTemplateResponseMixin,django.views.generic.detail.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
tests._testsite.apps.forum_conversation.models.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:
machina.apps.forum_moderation.views.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:
machina.apps.forum_moderation.views.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:
machina.apps.forum_moderation.views.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:
machina.apps.forum_permission.viewmixins.PermissionRequiredMixin,django.views.generic.detail.SingleObjectTemplateResponseMixin,django.views.generic.detail.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
tests._testsite.apps.forum_conversation.models.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.
-