def get_queryset(self):
        """
        Build a queryset of items with published entries and annotated
        with the number of entries and the latest modification date.
        """
        return self.model.published.annotate(
            count_entries_published=Count('entries')).annotate(
            last_update=Max('entries__last_update')).order_by(
            '-count_entries_published', '-last_update', '-pk')
Build a queryset of items with published entries and annotated
        with the number of entries and the latest modification date.