def _qs_for(model_cls):
 return model_cls.objects.filter(created__gte=date(2011, 1, 1)).extra(select={'day': 'extract( day from created )', 'month': 'extract( month from created )', 'year': 'extract( year from created )'}).values('year', 'month', 'day').annotate(count=Count('created'))

def _qs_for ( model_cls ) : return model_cls . objects . filter ( created__gte = date ( 2011 , 1 , 1 ) ) . extra ( select = { 'day' : 'extract( day from created )' , 'month' : 'extract( month from created )' , 'year' : 'extract( year from created )' } ) . values ( 'year' , 'month' , 'day' ) . annotate ( count = Count ( 'created' ) )
return the monthly grouped queryset we need for model_cls .