docs: def getComponentFilters(self,component,event=None,dateTime=None):
          '''
          Get a parsimonious set of intervals and the associated Q() objects
          based on the occurrences of a specified event, and the rule that
          implicitly defines the start and end of each interval.
          '''
  
          # Limit to the staff member or staff category specified by the rule.
          if component.staffMember:
              filters = Q(pk=component.staffMember.pk)
          else:
              filters = Q(eventstaffmember__category=component.staffCategory)
  
          # Handle 'Always' and 'EventOnly' rules first, because they do not require an analysis of intervals.
          if component.admissionRule == 'EventOnly' and event:
              # Skip the analysis of intervals and include only those who are staffed for the event.
              return Q(filters & Q(eventstaffmember__event=event))
          elif component.admissionRule in ['Always','EventOnly']:
              # If 'Always' or no event is specified, include all associated staff
              return Q(filters)
  
          # Start with the event occurrence intervals, or with the specified time.
          if event:
              intervals = [(x.startTime,x.endTime) for x in event.eventoccurrence_set.all()]
          elif dateTime:
              intervals = [(dateTime,dateTime)]
          else:
              raise ValueError(_('Must provide either an event or a datetime to get interval queries.'))
  
          if component.admissionRule == 'Day':
              # The complete days of each event occurrence
              intervals = [
                  (self.getDayStart(x[0]),self.getDayStart(x[1]) + timedelta(days=1)) for x in intervals
              ]
          elif component.admissionRule == 'Week':
              # The complete weeks of each event occurrence
              intervals = [
                  (
                      self.getDayStart(x[0]) - timedelta(days=x[0].weekday()),
                      self.getDayStart(x[1]) - timedelta(days=x[1].weekday() - 7)
                  ) for x in intervals
              ]
          elif component.admissionRule == 'Month':
              # The complete month of each event occurrence
              intervals = [
                  (
                      self.getDayStart(x[0]).replace(day=1),
                      self.getDayStart(x[1]).replace(day=1) + relativedelta(months=1)
                  ) for x in intervals
              ]
          elif component.admissionRule == 'Year':
              # The complete years of each event occurrence
              intervals = [
                  (
                      self.getDayStart(x[0]).replace(month=1,day=1),
                      self.getDayStart(x[1]).replace(year=x[1].year + 1,month=1,day=1)
                  ) for x in intervals
              ]
          else:
              # This is a failsafe that will always evaluate as False.
              return Q(pk__isnull=True)
  
          # Use intervaltree to create the most parsimonious set of intervals for this interval
          # and then filter on those intervals
          intervals = [sorted(x) for x in intervals]
          tree = IntervalTree.from_tuples(intervals)
          tree.merge_overlaps()
  
          # Since we are OR appending, start with something that is always False.
          intervalFilters = Q(pk__isnull=True)
  
          for item in tree.items():
              intervalFilters = intervalFilters | Q(
                  Q(eventstaffmember__event__eventoccurrence__endTime__gte=item[0]) &
                  Q(eventstaffmember__event__eventoccurrence__startTime__lte=item[1])
              )
  
          return Q(filters & intervalFilters)