forums.views module¶
-
class
forums.views.
ForumCreateView
(**kwargs)[source]¶ Bases:
scipost.mixins.PermissionsMixin
,django.views.generic.edit.CreateView
-
permission_required
= 'forums.add_forum'¶
-
model
¶ alias of
forums.models.Forum
-
form_class
¶ alias of
forums.forms.ForumForm
-
template_name
= 'forums/forum_form.html'¶
-
success_url
= '/forums/'¶
-
-
class
forums.views.
MeetingCreateView
(**kwargs)[source]¶ Bases:
forums.views.ForumCreateView
-
model
¶ alias of
forums.models.Meeting
-
form_class
¶ alias of
forums.forms.MeetingForm
-
-
class
forums.views.
ForumUpdateView
(**kwargs)[source]¶ Bases:
guardian.mixins.PermissionRequiredMixin
,django.views.generic.edit.UpdateView
-
permission_required
= 'forums.update_forum'¶
-
template_name
= 'forums/forum_form.html'¶
-
-
class
forums.views.
ForumDeleteView
(**kwargs)[source]¶ Bases:
guardian.mixins.PermissionRequiredMixin
,django.views.generic.edit.DeleteView
-
permission_required
= 'forums.delete_forum'¶
-
model
¶ alias of
forums.models.Forum
-
success_url
= '/forums/'¶
-
-
class
forums.views.
ForumDetailView
(**kwargs)[source]¶ Bases:
guardian.mixins.PermissionRequiredMixin
,django.views.generic.detail.DetailView
-
permission_required
= 'forums.can_view_forum'¶
-
model
¶ alias of
forums.models.Forum
-
template_name
= 'forums/forum_detail.html'¶
-
-
class
forums.views.
ForumPermissionsView
(**kwargs)[source]¶ Bases:
guardian.mixins.PermissionRequiredMixin
,django.views.generic.edit.UpdateView
-
permission_required
= 'forums.can_change_forum'¶
-
model
¶ alias of
forums.models.Forum
-
form_class
¶
-
template_name
= 'forums/forum_permissions.html'¶
-
-
class
forums.views.
ForumListView
(**kwargs)[source]¶ Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,django.views.generic.list.ListView
-
model
¶ alias of
forums.models.Forum
-
template_name
= 'forum_list.html'¶
-
-
class
forums.views.
PostCreateView
(**kwargs)[source]¶ Bases:
django.contrib.auth.mixins.UserPassesTestMixin
,django.views.generic.edit.CreateView
First step of a two-step Post creation process. This view, upon successful POST, redirects to the PostConfirmCreateView confirmation view.
To transfer form data from this view to the next (confirmation) one, two session variables are used,
post_subject
andpost_text
.-
model
¶ alias of
forums.models.Post
-
form_class
¶ alias of
forums.forms.PostForm
-
-
class
forums.views.
MotionCreateView
(**kwargs)[source]¶ Bases:
forums.views.PostCreateView
Specialization of PostCreateView to Motion-class objects.
By default, all users who can create a Post on the associated Forum are given voting rights.
-
model
¶ alias of
forums.models.Motion
-
form_class
¶ alias of
forums.forms.MotionForm
-
template_name
= 'forums/motion_form.html'¶
-
-
class
forums.views.
PostConfirmCreateView
(**kwargs)[source]¶ Bases:
forums.views.PostCreateView
Second (confirmation) step of Post creation process.
Upon successful POST, the Post object is saved and the two session variables
post_subject
andpost_text
are deleted.-
form_class
¶ alias of
forums.forms.PostForm
-
template_name
= 'forums/post_confirm_create.html'¶
-
form_valid
(form)[source]¶ After deleting the session variables used for the confirmation step, simply perform the form_valid calls of form_valid from ancestor classes ModelFormMixin and FormMixin, due to the fact that the form_valid method in the PostCreateView superclass was overriden to a redirect.
-
-
class
forums.views.
MotionConfirmCreateView
(**kwargs)[source]¶ Bases:
forums.views.PostConfirmCreateView
Specialization of PostConfirmCreateView to Motion-class objects.
-
form_class
¶ alias of
forums.forms.MotionForm
-
template_name
= 'forums/motion_confirm_create.html'¶
-
form_valid
(form)[source]¶ After deleting the session variables used for the confirmation step, simply perform the form_valid calls of form_valid from ancestor classes ModelFormMixin and FormMixin, due to the fact that the form_valid method in the PostCreateView superclass was overriden to a redirect.
-