code: def visible_to_user(self, user):
          
  
          return Announcement.objects.filter(
              Q(groups__in=user.groups.all()) | Q(groups__isnull=True) | Q(announcementrequest__teachers_requested=user) |
              Q(announcementrequest__user=user) | Q(user=user)).distinct()
docs: 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()...