AnnouncementManager¶
Qualified name: intranet.apps.announcements.models.AnnouncementManager
- class intranet.apps.announcements.models.AnnouncementManager(*args, **kwargs)[source]¶
Bases:
Manager
Methods
Get a list of announcements marked as hidden for a given user (usually request.user).
Get AnnouncementRequests from this school year only.
Get a list of visible announcements for a given user (usually request.user).
Attributes
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.
- 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()…