code: def lookups(self, request, model_admin):
          
          active_objects = self.model.published.all().annotate(
              count_entries_published=Count('entries')).order_by(
              '-count_entries_published', '-pk')
          for active_object in active_objects:
              yield (
                  str(active_object.pk), ungettext_lazy(
                      '%(item)s (%(count)i entry)',
                      '%(item)s (%(count)i entries)',
                      active_object.count_entries_published) % {
                      'item': smart_text(active_object),
                      'count': active_object.count_entries_published})
docs: Return published objects with the number of entries.