FeatureAnnouncement

Qualified name: intranet.apps.features.models.FeatureAnnouncement

class intranet.apps.features.models.FeatureAnnouncement(*args, **kwargs)[source]

Bases: Model

Represents an announcement about a new feature on Ion that should be shown to the school.

activation_date

The date on which this feature announcement should first appear.

Type:

datetime.date

expiration_date

The date on which this feature announcement should last appear.

Type:

datetime.date

context

The “context” (essentially the page) in which this feature announcement should be shown. Currently supported: dashboard, login, eighth_signup

Type:

str

announcement_html

The HTML of the actual announcement. WARNING: This is rendered as ‘safe’ to allow things like links. Do NOT allow untrusted content here.

Type:

str

users_seen

The users who have seen this feature announcement.

Type:

list of User

users_dismissed

The users who have dismissed this feature announcement (clicked the close button). Used to hide feature announcements the user has dismissed.

Type:

list of User

Parameters:
  • id (AutoField) – Primary key: ID

  • activation_date (DateField) – Activation date

  • expiration_date (DateField) – Expiration date

  • context (CharField) – Context

  • announcement_html (CharField) – Announcement html. The HTML for the feature announcement (do NOT allow untrusted content)

Relationship fields:

Parameters:
  • users_seen (ManyToManyField to User) – Users seen (related name: feature_announcements_seen)

  • users_dismissed (ManyToManyField to User) – Users dismissed (related name: feature_announcements_dismissed)

Methods

get_context_display

Shows the label of the context.

get_next_by_activation_date

Finds next instance based on activation_date.

get_next_by_expiration_date

Finds next instance based on expiration_date.

get_previous_by_activation_date

Finds previous instance based on activation_date.

get_previous_by_expiration_date

Finds previous instance based on expiration_date.

Attributes