docs: def json_event_feed(request,location_id=None,room_id=None):
      '''
      The Jquery fullcalendar app requires a JSON news feed, so this function
      creates the feed from upcoming PrivateEvent objects
      '''
  
      if not getConstant('calendar__privateCalendarFeedEnabled') or not request.user.is_staff:
          return JsonResponse({})
      this_user = request.user
  
      startDate = request.GET.get('start','')
      endDate = request.GET.get('end','')
      timeZone = request.GET.get('timezone',getattr(settings,'TIME_ZONE','UTC'))
  
      time_filter_dict_events = {}
      if startDate:
          time_filter_dict_events['startTime__gte'] = ensure_timezone(datetime.strptime(startDate,'%Y-%m-%d'))
      if endDate:
          time_filter_dict_events['endTime__lte'] = ensure_timezone(datetime.strptime(endDate,'%Y-%m-%d')) + timedelta(days=1)
  
      instructor_groups = list(this_user.groups.all().values_list('id',flat=True))
  
      filters = Q(event__privateevent__isnull=False) & (
          Q(event__privateevent__displayToGroup__in=instructor_groups) |
          Q(event__privateevent__displayToUsers=this_user) |
          (Q(event__privateevent__displayToGroup__isnull=True) & Q(event__privateevent__displayToUsers__isnull=True))
      )
  
      if location_id:
          filters = filters & Q(event__location__id=location_id)
      if room_id:
          filters = filters & Q(event__room_id=room_id)
  
      occurrences = EventOccurrence.objects.filter(filters).filter(**time_filter_dict_events).order_by('-startTime')
  
      eventlist = [EventFeedItem(x,timeZone=timeZone).__dict__ for x in occurrences]
  
      return JsonResponse(eventlist,safe=False)