Announcement

Qualified name: intranet.apps.announcements.models.Announcement

class intranet.apps.announcements.models.Announcement(*args, **kwargs)[source]

Bases: Model

Represents an announcement.

title

The title of the announcement

content

The HTML content of the news post

author

The name of the author

added

The date the announcement was added

updated

The most recent date the announcement was updated

user_map

An attribute corresponding with an AnnouncementUserMap object. A new object is automatically created if it does not exist.

Parameters:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:

Methods

can_modify

get_author

Returns 'author' if it is set.

get_next_by_added

Finds next instance based on added.

get_next_by_expiration_date

Finds next instance based on expiration_date.

get_next_by_updated

Finds next instance based on updated.

get_previous_by_added

Finds previous instance based on added.

get_previous_by_expiration_date

Finds previous instance based on expiration_date.

get_previous_by_updated

Finds previous instance based on updated.

is_visible

is_visible_requester

is_visible_submitter

save_without_historical_record

Save model without saving a historical record

Attributes

activity

Type: ForeignKey to EighthActivity

activity_id

Internal field, use activity instead.

added

Type: DateTimeField

announcementrequest

announcementrequest_set

Type: Reverse ForeignKey from AnnouncementRequest

author

Type: CharField

content

Type: TextField

content_no_links

Returns the content of this announcement with all links nullified.

dashboard_type

event

Type: Reverse ForeignKey from Event

expiration_date

Type: DateTimeField

groups

Type: ManyToManyField to Group

history

id

Type: AutoField

is_club_announcement

is_this_year

Return whether the announcement was created after July 1st of this school year.

notify_email_all

Type: BooleanField

notify_post

Type: BooleanField

objects

pinned

Type: BooleanField

public

Type: BooleanField

title

Type: CharField

updated

Type: DateTimeField

user

Type: ForeignKey to User

user_id

Internal field, use user instead.

user_map

Returns the content of this announcement with all links nullified.

Returns:

The content of this announcement with all links nullified.

get_author() str[source]

Returns ‘author’ if it is set. Otherwise, returns the name of the user who created the announcement.

Returns:

The name of the author as it should be displayed with the announcement.

property is_this_year

Return whether the announcement was created after July 1st of this school year.

save_without_historical_record(*args, **kwargs)

Save model without saving a historical record

Make sure you know what you’re doing before you use this method.