code: def with_active_flag(self):
          
          if self.model.KEY_FIELDS:
              return self.get_queryset().annotate(
                  is_active=models.ExpressionWrapper(
                      models.Q(pk__in=self._current_ids_subquery()),
                      output_field=models.IntegerField(),
                  )
              )
          return self.get_queryset().annotate(
              is_active=models.ExpressionWrapper(
                  models.Q(pk=self.model.current().pk),
                  output_field=models.IntegerField(),
              )
          )
docs: A query set where each result is annotated with an 'is_active' field that indicates
          if it's the most recent entry for that combination of keys.