#NEWLINE# def for_day( self , dt , date_field = None , aggregate_field = None , aggregate_class = None ) : #NEWLINE# #INDENT# date_field = ( date_field or self . date_field ) #NEWLINE# aggregate_class = ( aggregate_class or self . aggregate_class ) #NEWLINE# aggregate_field = ( agg or self . aggregate_field ) #NEWLINE# self . check_date_field ( date_field ) #NEWLINE# self . check_qs ( ) #NEWLINE# kwargs = { #NEWLINE# #INDENT# ( '%s__year' % date_field ) : dt . year , #NEWLINE# ( '%s__month' % date_field ) : dt . month , #NEWLINE# ( '%s__day' % date_field ) : dt . day , #NEWLINE# #UNINDENT# } #NEWLINE# agg = self . qs . filter ( ** kwargs ) . aggregate ( agg = aggregate_class ( aggregate_field ) ) #NEWLINE# return agg [ 'agg' ]