Views
Notification
¶
Bases: Model
RealGroup
¶
Bases: Group
RealGroups are created by the developer.
Most of the time they match a number in settings to be easily used for permissions.
CanCreateMixin
¶
Bases: View
Protect any child view that would create an object.
Raises:
Type | Description |
---|---|
PermissionDenied
|
If the user has not the necessary permission to create the object of the view. |
CanEditPropMixin
¶
Bases: GenericContentPermissionMixinBuilder
Ensure the user has owner permissions on the child view object.
In other word, you can make a view with this view as parent,
and it will be retricted to the users that are in the
object's owner_group or that pass the obj.can_be_viewed_by
test.
Raises:
Type | Description |
---|---|
PermissionDenied
|
If the user cannot see the object |
CanViewMixin
¶
Bases: GenericContentPermissionMixinBuilder
Ensure the user has permission to view this view's object.
Raises:
Type | Description |
---|---|
PermissionDenied
|
if the user cannot edit this view's object. |
DetailFormView
¶
Bases: SingleObjectMixin
, FormView
Class that allow both a detail view and a form view.
get_object()
¶
FormerSubscriberMixin
¶
Bases: AccessMixin
Check if the user was at least an old subscriber.
Raises:
Type | Description |
---|---|
PermissionDenied
|
if the user never subscribed. |
UVCommentForm(author_id, uv_id, is_creation, *args, **kwargs)
¶
Bases: ModelForm
Form handeling creation and edit of an UVComment.
Source code in pedagogy/forms.py
UVCommentModerationForm
¶
Bases: Form
Form handeling bulk comment deletion.
UVCommentReportForm(reporter_id, comment_id, *args, **kwargs)
¶
Bases: ModelForm
Form handeling creation and edit of an UVReport.
Source code in pedagogy/forms.py
UVForm(author_id, *args, **kwargs)
¶
Bases: ModelForm
Form handeling creation and edit of an UV.
Source code in pedagogy/forms.py
UV
¶
Bases: Model
Contains infos about an UV (course).
is_owned_by(user)
¶
can_be_viewed_by(user)
¶
has_user_already_commented(user)
¶
Help prevent multiples comments from the same user.
This function checks that no other comment has been posted by a specified user.
Returns:
Type | Description |
---|---|
bool
|
True if the user has already posted a comment on this UV, else False. |
Source code in pedagogy/models.py
UVCommentReport
¶
Bases: Model
Report an inapropriate comment.
UVDetailFormView
¶
Bases: CanViewMixin
, DetailFormView
Display every comment of an UV and detailed infos about it.
Allow to comment the UV.
UVCommentUpdateView
¶
Bases: CanEditPropMixin
, UpdateView
Allow edit of a given comment.
UVCommentDeleteView
¶
Bases: CanEditPropMixin
, DeleteView
Allow delete of a given comment.
UVGuideView
¶
Bases: LoginRequiredMixin
, FormerSubscriberMixin
, TemplateView
UV guide main page.
UVCommentReportCreateView
¶
Bases: CanCreateMixin
, CreateView
Create a new report for an inapropriate comment.
UVModerationFormView
¶
Bases: FormView
Moderation interface (Privileged).
UVCreateView
¶
Bases: CanCreateMixin
, CreateView
Add a new UV (Privileged).
UVDeleteView
¶
Bases: CanEditPropMixin
, DeleteView
Allow to delete an UV (Privileged).
UVUpdateView
¶
Bases: CanEditPropMixin
, UpdateView
Allow to edit an UV (Privilegied).