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:
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 (
ForeignKey
toUser
) – User (related name:user
)posted (
ForeignKey
toAnnouncement
) – Posted (related name:announcementrequest
)posted_by (
ForeignKey
toUser
) – Posted by (related name:posted_by
)rejected_by (
ForeignKey
toUser
) – Rejected by (related name:rejected_by
)teachers_requested (
ManyToManyField
toUser
) – Teachers requested (related name:teachers_requested
)teachers_approved (
ManyToManyField
toUser
) – Teachers approved (related name:teachers_approved
)
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
Type:
DateTimeField
Type:
BooleanField
author
Type:
CharField
Type:
TextField
expiration_date
Type:
DateTimeField
id
Type:
AutoField
Type:
TextField
objects
Type:
ForeignKey
toAnnouncement
Type:
ForeignKey
toUser
posted_by_id
Internal field, use
posted_by
instead.posted_id
Internal field, use
posted
instead.Type:
BooleanField
rejected_by
Type:
ForeignKey
toUser
rejected_by_id
Internal field, use
rejected_by
instead.Type:
ManyToManyField
toUser
Type:
ManyToManyField
toUser
Type:
CharField
Type:
DateTimeField
Type:
ForeignKey
toUser
user_id
Internal field, use
user
instead.