1 from django.template import Library
2 from django.db.models import Max
3 from ..models import Alert
11 'count': Alert.objects.all().count(),
12 'items': Alert.objects.all().annotate(
13 m=Max('book__chunk__head__created_at')
14 ).order_by('-m')[:20],