docs: def hook_get_results(self, changelist):
          """Triggered by `ChangeList.get_results()`."""
          result_list = list(changelist.result_list)
  
          if self.pid:
              # Render to upper level link.
              parent = changelist.model.objects.get(pk=self.pid)
              parent = changelist.model(pk=getattr(parent, self.pid_field_real, None))
              setattr(parent, self.UPPER_LEVEL_MODEL_ATTR, True)
              result_list = [parent] + result_list
  
          # Get children stats.
          kwargs_filter = {'%s__in' % self.pid_field: result_list}
  
          stats_qs = changelist.model.objects.filter(
              **kwargs_filter).values_list(self.pid_field).annotate(cnt=models.Count(self.pid_field))
  
          stats = {item[0]: item[1] for item in stats_qs}
  
          for item in result_list:
  
              if hasattr(item, self.CHILD_COUNT_MODEL_ATTR):
                  continue
  
              try:
                  setattr(item, self.CHILD_COUNT_MODEL_ATTR, stats[item.id])
  
              except KeyError:
                  setattr(item, self.CHILD_COUNT_MODEL_ATTR, 0)
  
          changelist.result_list = result_list