Forum tracking

The forum_tracking application allows to determine which forums or topics have been read by a given user. It provides mechanisms allowing users to mark forums or topics as read and to browse unread forums or topics.

Handler

class machina.apps.forum_tracking.handler.TrackingHandler(request=None)

Bases: object

Provides utility methods to compute unread forums and topics.

The TrackingHandler allows to filter list of forums and list of topics in order to get only the forums which contain unread topics or the unread topics.

get_unread_forums(user)

Returns the list of unread forums for the given user.

get_unread_forums_from_list(user, forums)

Returns the list of unread forums for the given user from a given list of forums.

get_unread_topics(topics, user)

Returns a list of unread topics for the given user from a given set of topics.

mark_forums_read(forums, user)

Marks a list of forums as read.

mark_topic_read(topic, user)

Marks a topic as read.

Views

class machina.apps.forum_tracking.views.MarkForumsReadView(**kwargs)

Bases: django.views.generic.base.TemplateView

Marks a set of forums as read.

get_top_level_forum_url()

Returns the parent forum from which forums are marked as read.

mark_as_read(request, pk)

Marks the considered forums as read.

class machina.apps.forum_tracking.views.MarkTopicsReadView(**kwargs)

Bases: machina.apps.forum_permission.viewmixins.PermissionRequiredMixin, django.views.generic.detail.SingleObjectTemplateResponseMixin, django.views.generic.detail.BaseDetailView

Marks a set of topics as read.

get_controlled_object()

Return the considered forum in order to allow permission checks.

get_forum_url()

Returns the url of the forum whose topics will be marked read.

model

alias of Forum

class machina.apps.forum_tracking.views.UnreadTopicsView(**kwargs)

Bases: django.views.generic.list.ListView

Displays unread topics for the current user.