AnnouncementManager

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

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

Bases: Manager

Methods

hidden_announcements

Get a list of announcements marked as hidden for a given user (usually request.user).

this_year

Get AnnouncementRequests from this school year only.

visible_to_user

Get a list of visible announcements for a given user (usually request.user).

Attributes

hidden_announcements(user)[source]

Get a list of announcements marked as hidden for a given user (usually request.user).

These are all announcements visible to the user – they have just decided to hide them.

this_year()[source]

Get AnnouncementRequests from this school year only.

visible_to_user(user)[source]

Get a list of visible announcements for a given user (usually request.user).

These visible announcements will be those that either have no groups assigned to them (and are therefore public) or those in which the user is a member.

Apparently this .filter() call occasionally returns duplicates, hence the .distinct()…