Forum Views

inyoka.forum.views

The views for the forum.

copyright:
  1. 2007-2024 by the Inyoka Team, see AUTHORS for more details.

license:

BSD, see LICENSE for more details.

class inyoka.forum.views.ForumAtomFeed

Atom feed with new topics of the whole forum.

_subtitle(__)

Small helper which returns the subtitle content. Modify it in the subclass.

item_author_name(topic)
item_categories(topic)
item_description(topic)
item_pubdate(topic)
item_title(topic)
item_updateddate(topic)
items(_)
name = 'forum_forum_feed'
title = 'ubuntuusers.local:8080 forum'
class inyoka.forum.views.ForumCreateView(**kwargs)

View to create a new forum.

class inyoka.forum.views.ForumEditMixin

Mixin for the ForumCreateView and the ForumUpdateView.

form_class

alias of EditForumForm

form_valid(form)
model

alias of Forum

permission_required = 'forum.change_forum'
template_name = 'forum/forum_edit.html'
class inyoka.forum.views.ForumTopicAtomFeed

Atom feed with posts of a topic.

_subtitle(topic)

Small helper which returns the subtitle content. Modify it in the subclass.

get_object(request, *args, **kwargs)
item_author_name(post)
item_description(post)
item_pubdate(post)
item_title(post)
item_updateddate(post)
items(topic)
name = 'forum_topic_feed'
title(topic)
class inyoka.forum.views.ForumUpdateView(**kwargs)

View to update an existing forum.

class inyoka.forum.views.OneForumAtomFeed

Atom feed with new topics of one forum.

_subtitle(forum)

Small helper which returns the subtitle content. Modify it in the subclass.

get_object(request, *args, **kwargs)
items(forum)

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

title(forum)

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

class inyoka.forum.views.WelcomeMessageView(**kwargs)

View has shows the welcome message of a forum.

The user can accept the message with a post request with the key accept set to True.

dispatch(*args, **kwargs)

If the forum does not have a welcome message, then 404 is raised.

model

alias of Forum

permission_required = 'forum.view_forum'
post(*args, **kwargs)

Set the accepted status of the request.user to either accepted or rejected and redirects to the main forum page if rejected or to the forum if accepted.

template_name = 'forum/welcome.html'
inyoka.forum.views._generate_subscriber(cls, obj_slug, subscriptionkw, flasher)

Generates a subscriber-function to deal with objects of type obj which have the slug slug and are registered in the subscription by subscriptionkw and have the flashing-test flasher

inyoka.forum.views._generate_unsubscriber(cls, obj_slug, subscriptionkw, flasher, page=1)

Generates an unsubscriber-function to deal with objects of type obj which have the slug slug and are registered in the subscription by subscriptionkw and have the flashing-test flasher

inyoka.forum.views.delete_post(request, *args, **kwargs)

Sets the hidden flag of a post to True if action == ‘hide’. which has the effect that normal users can’t see it anymore (moderators still can). If action == ‘delete’ really deletes the post.

inyoka.forum.views.delete_topic(request, topic_slug, action='hide')

Sets the hidden flag of a topic to True if action==’hide’, which has the effect that normal users can’t see it anymore (moderators still can). Completely deletes the topic if action==’delete’.

inyoka.forum.views.edit(request, *args, **kwargs)

This function allows the user to create a new topic which is created in the forum slug if slug is a string. Else a new discussion for the wiki article article is created inside a special forum that contains wiki discussions only (see the WIKI_DISCUSSION_FORUM setting). It’s title is set to the wiki article’s name. When creating a new topic, the user has the choice to upload files bound to this topic or to create one or more polls.

inyoka.forum.views.first_unread_post(request, topic_slug)

Redirect the user to the first unread post in a special topic.

inyoka.forum.views.forum(request, *args, **kwargs)

Return a single forum to show a topic list.

inyoka.forum.views.handle_attachments(request, post, att_ids)

Handle creation of attachments.

This function is called by edit() to handle the creation of attachments.

Parameters:
  • request – current request.

  • post – The current post that gets edited. Can be None.

  • att_ids – A list of integers representing existing attachments.

inyoka.forum.views.handle_polls(request, topic, poll_ids)

Handle creation of polls.

This function is called from edit() to handle the creation of polls. It can happen that a poll with no topic_id is created, this is a result of the inline-editing feature so that we have no chance to properly delete those poll objects once the user canceled his action.

Parameters:
  • request – The current request

  • topic – The current topic object. Can be None.

  • poll_ids – A list of integers representing the existing poll ids to bind and show them properly.

inyoka.forum.views.index(request, *args, **kwargs)

Return all forums without parents. These forums are treated as categories but not as real forums.

inyoka.forum.views.last_post(request, topic_slug)

Redirect to the last post of the given topic.

inyoka.forum.views.lock_topic(request, topic_slug, locked, page=1)

Lock/unlock a topic and redirect to it

inyoka.forum.views.mark_ham_spam(request, *args, **kwargs)
inyoka.forum.views.markread(request, slug=None)

Mark either all or only the given forum as read.

inyoka.forum.views.movetopic(request, *args, **kwargs)

Move a topic into another forum

inyoka.forum.views.next_topic(*args, **kwargs)
inyoka.forum.views.post(request, post_id)

Redirect to the “real” post url (see PostManager.url_for_post)

inyoka.forum.views.postlist(request, *args, **kwargs)
inyoka.forum.views.previous_topic(*args, **kwargs)
inyoka.forum.views.report(request, *args, **kwargs)

Change the report_status of a topic and redirect to it

inyoka.forum.views.reported_topics_subscription(request, mode)
inyoka.forum.views.reportlist(request, *args, **kwargs)

Get a list of all reported topics

inyoka.forum.views.restore_post(request, *args, **kwargs)

This function removes the hidden flag of a post to make it visible for normal users again.

inyoka.forum.views.restore_revision(request, *args, **kwargs)
inyoka.forum.views.restore_topic(request, *args, **kwargs)

This function removes the hidden flag of a topic to make it visible for normal users again.

inyoka.forum.views.revisions(request, *args, **kwargs)
inyoka.forum.views.solve_topic(request, topic_slug, solved, page=1)

Solve/unsolve a topic and redirect to it

inyoka.forum.views.splittopic(request, *args, **kwargs)
inyoka.forum.views.subscribe_forum(request, **kwargs)
inyoka.forum.views.subscribe_topic(request, **kwargs)
inyoka.forum.views.topiclist(request, *args, **kwargs)
inyoka.forum.views.unsubscribe_forum(request, **kwargs)
inyoka.forum.views.unsubscribe_topic(request, **kwargs)
inyoka.forum.views.viewtopic(request, *args, **kwargs)

Shows a topic, the posts are paginated. If the topic has a hidden flag, the user gets a nice message that the topic is deleted and is redirected to the topic’s forum. Moderators can see these topics.