Forum member¶
The forum_member
application provides functionalities to forum members and defines forum profile
abstract models.
Abstract models¶
Forum member abstract models¶
This module defines abstract models provided by the forum_member
application.
- class machina.apps.forum_member.abstract_models.AbstractForumProfile(*args, **kwargs)¶
Bases:
django.db.models.base.Model
Represents the profile associated with each forum user.
- get_avatar_upload_to(filename)¶
Returns the path to upload the associated avatar to.
- machina.apps.forum_member.abstract_models.get_profile_avatar_upload_to(instance, filename)¶
Returns a valid upload path for the avatar associated with a forum profile.
Shortcuts¶
Forum member shortcuts¶
This module defines shortcut functions allowing to easily get forum member information.
- machina.apps.forum_member.shortcuts.get_forum_member_display_name(user)¶
Given a specific user, returns their related display name.
Views¶
Forum member views¶
This module defines views provided by the forum_member
application.
- class machina.apps.forum_member.views.ForumProfileDetailView(**kwargs)¶
Bases:
django.views.generic.detail.DetailView
Shows a user’s forum profile.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_object(queryset=None)¶
Returns the considered object.
- get_queryset()¶
Returns the list of items for this view.
- class machina.apps.forum_member.views.ForumProfileUpdateView(**kwargs)¶
Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,django.views.generic.edit.UpdateView
Allows the current user to update its forum profile.
- form_class¶
alias of
machina.apps.forum_member.forms.ForumProfileForm
- form_valid(form)¶
Handles a valid form.
- get_object(queryset=None)¶
Returns the considered object.
- get_success_url()¶
Returns the success URL to redirect the user to.
- class machina.apps.forum_member.views.TopicSubscribeView(**kwargs)¶
Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,machina.apps.forum_permission.viewmixins.PermissionRequiredMixin
,django.views.generic.detail.SingleObjectTemplateResponseMixin
,django.views.generic.detail.BaseDetailView
Allows a user to subscribe to a specific topic.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- 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 permission check.
- post(request, *args, **kwargs)¶
Handles POST requests.
- subscribe(request, *args, **kwargs)¶
Performs the subscribe action.
- class machina.apps.forum_member.views.TopicSubscriptionListView(**kwargs)¶
Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,django.views.generic.list.ListView
Provides a list of all topics to which the current user has subscribed.
- get_queryset()¶
Returns the list of items for this view.
- model¶
alias of
tests._testsite.apps.forum_conversation.models.Topic
- class machina.apps.forum_member.views.TopicUnsubscribeView(**kwargs)¶
Bases:
django.contrib.auth.mixins.LoginRequiredMixin
,machina.apps.forum_permission.viewmixins.PermissionRequiredMixin
,django.views.generic.detail.SingleObjectTemplateResponseMixin
,django.views.generic.detail.BaseDetailView
Allows a user to unsubscribe from a specific topic.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- 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 permission check.
- post(request, *args, **kwargs)¶
Handles POST requests.
- unsubscribe(request, *args, **kwargs)¶
Performs the unsubscribe action.
- class machina.apps.forum_member.views.UserPostsView(**kwargs)¶
Bases:
django.views.generic.list.ListView
Provides a list of all the posts submitted by a given a user.
- get_context_data(**kwargs)¶
Returns the context data to provide to the template.
- get_queryset()¶
Returns the list of items for this view.
- poster¶
Returns the considered user.