Forum Models

inyoka.forum.models

Database models 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.models.Attachment(*args, **kwargs)

Represents an attachment associated to a post.

exception DoesNotExist
exception MultipleObjectsReturned
_meta = <Options for Attachment>
comment

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property contents

The raw contents of the file. This is usually unsafe because it can cause the memory limit to be reached if the file is too big.

This method only opens files that are less than 1KB great, if the file is greater we return None.

static create(name, uploaded_file, mime, attachments, override=False, **kwargs)

This method writes a new attachment bound to a post that is not written into the database yet. It either returns the new created attachment or None if another attachment with that name already exists (and override is False).

Parameters:
name

The file name of the attachment.

uploaded_file

The attachment.

mime

The mimetype of the attachment (guess_file is implemented as fallback)

attachments

A list that includes attachments that are already attached to this (not-yet-existing) post.

override

Specifies whether other attachments for the same post should be overwritten if they have the same name.

delete()

Delete the attachment from the filesystem and also mark the database-object for deleting.

file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
get_absolute_url(action=None)
get_thumbnail_path()

Returns the path to the thumbnail file.

property html_representation

This method returns a HTML representation of the attachment for the show_action page. If this method does not know about an internal representation for the object the return value will be an download link to the raw attachment.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

mimetype

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
post

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

post_id
property size

The size of the attachment in bytes.

static update_post_ids(att_ids, post)

Update the post_id of a few unbound attachments.

Parameters:
  • att_ids (list) – A list of the attachment’s ids.

  • post (Post) – The new post object.

class inyoka.forum.models.Forum(*args, **kwargs)

This is a forum that may contain subforums or topics.

If parent is None this forum is a category, else it’s a common forum that can contain topics. Position is an integer that’s used to sort the forums. The lower position is, the higher the forum is displayed.

exception DoesNotExist
exception MultipleObjectsReturned
_children

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

_meta = <Options for Forum>
property children
clear_welcome()

Resets the read status of all users to this forum.

property descendants

Linke children but also returns the children of the children and so on.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

filter_children(forums)
find_welcome(user)

Return a forum with an unread welcome message if exits. The message itself, can be retrieved late, by reading the welcome_message attribute.

force_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_absolute_url(action='show', **query)
static get_children_recursive(forums, parent=None, offset=0)

Yield all forums sorted as in the index page, with indentation. forums must be sorted by position. Every entry is a tuple (offset, forum). Example usage:

forums = Forum.objects.order_by('-position').all()
for offset, f in Forum.get_children_recursive(forums):
    choices.append((f.id, u'  ' * offset + f.name))
get_parents(cached=True)

Return a list of all parent forums up to the root level.

get_read_status(user)

Determine the read status of the whole forum for a specific user.

get_supporters()
static get_welcome_text_rendered(text, context=None)

Renders a specific text with the configuration of this field.

This is needed to render text that is not in the database (for example the preview).

The argument context has to be a RenderContext object or a dictonary containing additional keywordarguments to generate the RenderContext object.

This method is bound to the django models as staticmethod, so it can also be called from the Model and not only from the instance.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

invalidate_topic_cache()
property is_category
is_welcome_text_in_cache()
last_post

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

last_post_id
mark_read(user)

Mark all topics in this forum and all related subforums as read for the specificed user.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

newtopic_default_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <inyoka.forum.models.ForumManager object>
parent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_id
property parents
position

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property post_count

Counts all posts from this forum and all child forums.

read_welcome(user, accepted=True)

Set the read status of the welcome message of the forum for the user.

If accepted is True, then the message is accepted. If it is False, then the read status is removed, so it is the same like with a new user.

remove_welcome_text_from_cache()
slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

support_group

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

support_group_id
property topic_count

Count all topics from this forum and not of the child forums.

The child forums can not be counted, because the counter is used for the pagination of the forum.

topics

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

user_count_posts

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

welcome_read_users

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

welcome_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property welcome_text_rendered

Renders the content of the field.

welcome_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class inyoka.forum.models.ForumManager(*args, **kwargs)
get(ident=None, slug=None, id=None)

Unified .get method that accepts either a id or a slug.

The forum object is retrieved from cache whenever possible.

get_all_forums_cached()

Return all forum objects from cache.

Every forum is retrieved from cache, if it’s not yet cached it is stored in the cache afterwards.

get_cached(slug=None)

Return either all or one forum from cache.

Parameters:

slug – If slug is given only one forum is returned. If slug is None (default) all forums get returned.

get_categories()
get_forums_filtered(user, priv='forum.view_forum', reverse=False, sort=False)

Return all forums the user has proper privileges for.

Parameters:
  • userinyoka.portal.user.User instance.

  • priv – A string representing a privilege

  • reverse – Reverse the filtering (visible/unvisible), default is that only visible forums are returned.

  • sort – Sort the output by position.

get_ids()

Return all forum ids from cache.

get_slugs()

Return a slug map.

The slug map is a dictionary of {Forum.id: Forum.slug} and is retrieved from cache.

get_sorted(reverse=False, attr='position')
static update_last_post(forums: List[Forum], exclude_topic: Topic | None = None, exclude_post: Post | None = None) None

Updates last_post of the given forums. last_post of a forum is expected to be the most recent post, as such this method just set the highest id (== max recent posts) as last_post.

exclude_topic should be used when a topic is deleted to exclude all

posts of the topic from being a potential new last post.

exclude_post should be used when a post is deleted to exclude the post

from being a potential last post.

Both parameters are needed, as a topic/post can not be deleted, if they are still referenced by a forum.

class inyoka.forum.models.Poll(id, question, start_time, end_time, multiple_votes, topic)
exception DoesNotExist
exception MultipleObjectsReturned
_meta = <Options for Poll>
can_vote

Returns a boolean whether the current user can vote in this poll.

end_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property ended

Returns a boolean whether the poll ended already

get_next_by_start_time(*, field=<django.db.models.fields.DateTimeField: start_time>, is_next=True, **kwargs)
get_previous_by_start_time(*, field=<django.db.models.fields.DateTimeField: start_time>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

multiple_votes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
options

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

property participated
question

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

start_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

topic

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

topic_id
votes

Calculate the total number of votes in this poll.

votings

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class inyoka.forum.models.PollOption(id, poll, name, votes)
exception DoesNotExist
exception MultipleObjectsReturned
_meta = <Options for PollOption>
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
property percentage

Calculate the percentage of votes for this poll option.

poll

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

poll_id
votes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class inyoka.forum.models.PollVote(id, voter, poll)
exception DoesNotExist
exception MultipleObjectsReturned
_meta = <Options for PollVote>
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
poll

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

poll_id
voter

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

voter_id
class inyoka.forum.models.Post(*args, **kwargs)

Represents a post in a topic.

exception DoesNotExist
exception MultipleObjectsReturned
_meta = <Options for Post>
attachments

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

author

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

author_id
check_ownpost_limit(type='edit')
delete(*args, **kwargs)

Delete the post and apply environmental changes.

This method recalculates the post_count, updates the last and first posts of all parent forums.

Note: The cache for all parent forums is explicitely deleted

to update last/first post properly.

edit(text, is_plaintext=False)

Change the text of the post. If the post is already stored in the database, create a post revision containing the new text. If the text has not changed, return.

Note

This method saves the current state of the post and it’s revisions. You do not have to do that yourself.

forum_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_absolute_url(action='show')
get_next_by_pub_date(*, field=<django.db.models.fields.DateTimeField: pub_date>, is_next=True, **kwargs)
get_previous_by_pub_date(*, field=<django.db.models.fields.DateTimeField: pub_date>, is_next=False, **kwargs)
get_text()
static get_text_rendered(text, context=None)

Renders a specific text with the configuration of this field.

This is needed to render text that is not in the database (for example the preview).

The argument context has to be a RenderContext object or a dictonary containing additional keywordarguments to generate the RenderContext object.

This method is bound to the django models as staticmethod, so it can also be called from the Model and not only from the instance.

property grouped_attachments
has_attachments

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

has_revision

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

hidden

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

hide(change_post_counter=True)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_plaintext

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_text_in_cache()
lock_key_base = 'forum/post_lock'

Must be defined by an inherited model.

mark_ham()
mark_spam(report=True, update_akismet=True)
objects = <inyoka.forum.models.PostManager object>
property page

this returns None if page is 1, use post.page or 1 if you need number

position

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pub_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

remove_text_from_cache()
revisions

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

show(change_post_counter=True)
static split(posts, old_topic, new_topic)

This function splits posts out of old_topic and moves them into new_topic. It is important that posts is a list of posts ordered by id ascending.

text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property text_rendered

Renders the content of the field.

topic

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

topic_id
static url_for_post(id, paramstr=None)
class inyoka.forum.models.PostManager(*args, **kwargs)
last_post_map(ids)

Return a mapping from post id to Post instances.

This method defers heavy fields.

class inyoka.forum.models.PostRevision(*args, **kwargs)

This saves old and current revisions of posts.

It can be used to restore posts if something odd was done or to view changes.

exception DoesNotExist
exception MultipleObjectsReturned
_meta = <Options for PostRevision>
get_absolute_url(action='restore')
get_next_by_store_date(*, field=<django.db.models.fields.DateTimeField: store_date>, is_next=True, **kwargs)
get_previous_by_store_date(*, field=<django.db.models.fields.DateTimeField: store_date>, is_next=False, **kwargs)
static get_text_rendered(text, context=None)

Renders a specific text with the configuration of this field.

This is needed to render text that is not in the database (for example the preview).

The argument context has to be a RenderContext object or a dictonary containing additional keywordarguments to generate the RenderContext object.

This method is bound to the django models as staticmethod, so it can also be called from the Model and not only from the instance.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_text_in_cache()
objects = <django.db.models.manager.Manager object>
post

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

post_id
remove_text_from_cache()
restore(request)

Edits the text of the post the revision belongs to and deletes the revision.

store_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property text_rendered

Renders the content of the field.

class inyoka.forum.models.ReadStatus(serialized_data)

Manages the read status of forums and topics for a specific user.

__add_topics_read_state_to_forum(parent_forum_id, last_post_id_in_topic)

This saves the read state to the parent forum. It also_limits the number of topics for which the read status is stored to FORUM_LIMIT_UNREAD. If this number is reached, the older half of the stored entries will be discarded.

mark(item, user)

Mark a forum or topic as read. Note that you must save the database changes explicitly!

serialize()
class inyoka.forum.models.Topic(*args, **kwargs)

A topic symbolizes a bunch of posts (at least one) that is located inside a forum. When creating a new topic, a new post is added to it automatically.

exception DoesNotExist
exception MultipleObjectsReturned
TITLE_MAX_LENGTH = 100
_meta = <Options for Topic>
author

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

author_id
cached_forum()
delete(*args, **kwargs)
first_post

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

first_post_id
forum

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

forum_id
get_absolute_url(action='show', **query)
get_pagination()
get_read_status(user)
static get_reported_rendered(text, context=None)

Renders a specific text with the configuration of this field.

This is needed to render text that is not in the database (for example the preview).

The argument context has to be a RenderContext object or a dictonary containing additional keywordarguments to generate the RenderContext object.

This method is bound to the django models as staticmethod, so it can also be called from the Model and not only from the instance.

get_ubuntu_version()

Returns a UbuntuVersion Object if this topic is linked to any Ubuntu Version, else None.

get_version_info(default=None)
has_poll

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

hidden

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_reported_in_cache()
last_post

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

last_post_id
locked

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

mark_read(user)

Mark the current topic as read for a given user.

move(new_forum)

Move the topic to another forum.

objects = <inyoka.forum.models.TopicManager object>
page_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

property paginated

Returns True when pagination is needed to show this topic.

Pagination is needed when there are more posts in the topic, then POSTS_PER_PAGE

polls

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

property post_count
posts

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

remove_reported_from_cache()
report_claimed_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

report_claimed_by_id
reported

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property reported_rendered

Renders the content of the field.

reporter

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

reporter_id
slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

solved

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

sticky

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

touch()

Increment the view count in a safe way.

ubuntu_distro

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ubuntu_version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

view_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class inyoka.forum.models.TopicManager(*args, **kwargs)
get_latest(forum: Forum | None = None, count: int | None = 10, user: User | None = None) QuerySet

Returns a queryset of the last-updated topics in this forum (and potential sub forums).

The returned topics
  • do not include hidden topics

  • respect the user’s permissions (if none is given, anonymous is assumed)

  • ignore stickiness (thus, sticky objects aren’t at the top!)

Raises PermissionDenied, if
  • the user has no permission to view the passed forum or

  • a user has no permission to view at least one forum

Parameters:
  • forum – Optionally, restrict to a forum and its sub forums. If None, all forums (with permissions) are used.

  • count – Restricts the number of returned topics

  • user – User-object that is used to check permissions (if none is given, anonymous is assumed)

prepare_for_overview(topic_ids)
inyoka.forum.models.fix_plaintext(text)
inyoka.forum.models.mark_all_forums_read(user)

Shortcut to mark all forums as read to prevent serializing to often.