AnnouncementRequest

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

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

Bases: Model

Represents a request for an announcement.

title

The title of the announcement

content

The HTML content of the news post

notes

Notes for the person who approves the announcement

added

The date the request was added

updated

The most recent date the request was updated

user

The user who submitted the request

teachers_requested

The teachers requested to approve the request

teachers_approved

The teachers who have approved the request

posted

ForeignKey to Announcement if posted

posted_by

The user (administrator) that approved the request

rejected

Boolean describing whether the post was rejected by an administrator. This will hide it.

admin_email_sent

Boolean describing whether an email was sent to an Intranet administrator to post the announcement.

Parameters:

Relationship fields:

Parameters:

Methods

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.

Attributes

added

Type: DateTimeField

admin_email_sent

Type: BooleanField

author

Type: CharField

content

Type: TextField

expiration_date

Type: DateTimeField

id

Type: AutoField

notes

Type: TextField

objects

posted

Type: ForeignKey to Announcement

posted_by

Type: ForeignKey to User

posted_by_id

Internal field, use posted_by instead.

posted_id

Internal field, use posted instead.

rejected

Type: BooleanField

rejected_by

Type: ForeignKey to User

rejected_by_id

Internal field, use rejected_by instead.

teachers_approved

Type: ManyToManyField to User

teachers_requested

Type: ManyToManyField to User

title

Type: CharField

updated

Type: DateTimeField

user

Type: ForeignKey to User

user_id

Internal field, use user instead.