oioioi.forum.models

Module Contents

Classes

Forum

Forum is connected with contest

Category

Category model

Thread

Thread model - topic in a category

Post

Post - the basic part of the forum

PostReaction

PostReaction - represents a reaction to a post on the forum.

Ban

Ban model - represents a ban on a forum. Banned person should not be

Functions

_set_as_new_last_post(sender, instance, created, **kwargs)

_update_last_post(sender, instance, **kwargs)

_remove_reports_if_approved(sender, instance, **kwargs)

Attributes

class oioioi.forum.models.Forum(*args, **kwargs)[source]

Bases: django.db.models.Model

Forum is connected with contest

class Meta[source]

Bases: object

verbose_name[source]
verbose_name_plural[source]
contest[source]
visible[source]
lock_date[source]
unlock_date[source]
__str__()[source]

Return str(self).

is_autolocked(now=None)[source]

Returns true if forum is locked

is_autounlocked(now=None)[source]

Returns true if forum was unlocked

is_locked(now=None)[source]

Returns true if forum is locked and not unlocked

class oioioi.forum.models.Category(*args, **kwargs)[source]

Bases: django.db.models.Model

Category model

class Meta[source]

Bases: object

verbose_name[source]
verbose_name_plural[source]
unique_together = ['forum', 'order'][source]
ordering = ['order'][source]
forum[source]
name[source]
order[source]
reactions_enabled[source]
short_description[source]
short_description[source]
short_description[source]
__str__()[source]

Return str(self).

count_threads()[source]
count_posts()[source]
count_reported()[source]
get_admin_url()[source]
save(**kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class oioioi.forum.models.Thread(*args, **kwargs)[source]

Bases: django.db.models.Model

Thread model - topic in a category

class Meta[source]

Bases: object

ordering = ['-last_post__id'][source]
verbose_name[source]
verbose_name_plural[source]
category[source]
name[source]
last_post[source]
short_description[source]
short_description[source]
__str__()[source]

Return str(self).

count_posts()[source]
count_reported()[source]
get_admin_url()[source]
class oioioi.forum.models.Post(*args, **kwargs)[source]

Bases: django.db.models.Model

Post - the basic part of the forum

class PostsWithReactionsSummaryManager[source]

Bases: django.db.models.Manager

get_queryset()[source]
class Meta[source]

Bases: object

index_together = [['thread', 'add_date']][source]
ordering = ['add_date'][source]
verbose_name[source]
verbose_name_plural[source]
property edited[source]
thread[source]
content[source]
add_date[source]
last_edit_date[source]
author[source]
reported[source]
report_reason[source]
approved[source]
hidden[source]
reported_by[source]
objects[source]
__str__()[source]

Return str(self).

get_admin_url()[source]
get_in_thread_url()[source]
can_be_removed()[source]
is_author_banned()[source]
is_reporter_banned()[source]
oioioi.forum.models.post_reaction_types[source]
class oioioi.forum.models.PostReaction(*args, **kwargs)[source]

Bases: django.db.models.Model

PostReaction - represents a reaction to a post on the forum.

post[source]
author[source]
type_of_reaction[source]
class oioioi.forum.models.Ban(*args, **kwargs)[source]

Bases: django.db.models.Model

Ban model - represents a ban on a forum. Banned person should not be allowed any ‘write’ interaction with forum. This includes reporting posts.

user[source]
forum[source]
admin[source]
created_at[source]
reason[source]
static is_banned(forum, user)[source]
__str__()[source]

Return str(self).

oioioi.forum.models._set_as_new_last_post(sender, instance, created, **kwargs)[source]
oioioi.forum.models._update_last_post(sender, instance, **kwargs)[source]
oioioi.forum.models._remove_reports_if_approved(sender, instance, **kwargs)[source]