code: def visible_to_user(self, user):
          
  
          return (Event.objects.filter(approved=True).filter(Q(groups__in=user.groups.all()) | Q(groups__isnull=True) | Q(user=user)))
docs: Get a list of visible events for a given user (usually request.user).
  
          These visible events will be those that either have no groups
          assigned to them (and are therefore public) or those in which
          the user is a member.