AnnouncementRequest¶
Qualified name: intranet.apps.announcements.models.AnnouncementRequest
- class intranet.apps.announcements.models.AnnouncementRequest(*args, **kwargs)[source]¶
Bases:
ModelRepresents 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:
id (AutoField) – Primary key: ID
title (CharField) – Title
content (TextField) – Content
author (CharField) – Author
expiration_date (DateTimeField) – Expiration date
notes (TextField) – Notes
added (DateTimeField) – Added
updated (DateTimeField) – Updated
rejected (BooleanField) – Rejected
admin_email_sent (BooleanField) – Admin email sent
Relationship fields:
- Parameters:
user (
ForeignKeytoUser) – User (related name:user)posted (
ForeignKeytoAnnouncement) – Posted (related name:announcementrequest)posted_by (
ForeignKeytoUser) – Posted by (related name:posted_by)rejected_by (
ForeignKeytoUser) – Rejected by (related name:rejected_by)teachers_requested (
ManyToManyFieldtoUser) – Teachers requested (related name:teachers_requested)teachers_approved (
ManyToManyFieldtoUser) – Teachers approved (related name:teachers_approved)
Methods
get_next_by_addedFinds next instance based on
added.get_next_by_expiration_dateFinds next instance based on
expiration_date.get_next_by_updatedFinds next instance based on
updated.get_previous_by_addedFinds previous instance based on
added.get_previous_by_expiration_dateFinds previous instance based on
expiration_date.get_previous_by_updatedFinds previous instance based on
updated.Attributes
Type:
DateTimeFieldType:
BooleanFieldauthorType:
CharFieldType:
TextFieldexpiration_dateType:
DateTimeFieldidType:
AutoFieldType:
TextFieldobjectsType:
ForeignKeytoAnnouncementType:
ForeignKeytoUserposted_by_idInternal field, use
posted_byinstead.posted_idInternal field, use
postedinstead.Type:
BooleanFieldrejected_byType:
ForeignKeytoUserrejected_by_idInternal field, use
rejected_byinstead.Type:
ManyToManyFieldtoUserType:
ManyToManyFieldtoUserType:
CharFieldType:
DateTimeFieldType:
ForeignKeytoUseruser_idInternal field, use
userinstead.