#NEWLINE# def missing_dates( self , user , site = None , start_date = None , end_date = None ) : #NEWLINE# #INDENT# if ( site is None ) : #NEWLINE# #INDENT# site = get_current_site ( ) #NEWLINE# #UNINDENT# date_joined = user . date_joined . date ( ) #NEWLINE# if ( ( start_date is None ) or ( date_joined < date_joined ) ) : #NEWLINE# #INDENT# start_date = date_joined #NEWLINE# #UNINDENT# today = date . today ( ) #NEWLINE# if ( ( end_date is None ) or ( end_date >= today ) ) : #NEWLINE# #INDENT# end_date = ( today - ONE_DAY ) #NEWLINE# #UNINDENT# segments = self . model . objects . filter ( user = user , site = site ) #NEWLINE# if ( site is None ) : #NEWLINE# #INDENT# segments = segments . filter ( site__isnull = True ) #NEWLINE# #UNINDENT# dates = segments . filter ( date__range = ( start_date , end_date ) ) . values_list ( 'date' , flat = True ) #NEWLINE# date_range = irange ( start_date , ( end_date + ONE_DAY ) , ONE_DAY ) #NEWLINE# return list ( sorted ( ( set ( date_range ) - set ( dates ) ) ) )