#NEWLINE# def get_context_data( self , **kwargs ) : #NEWLINE# #INDENT# context = super ( MainView , self ) . get_context_data ( ** kwargs ) #NEWLINE# domains_and_latest_counts = [ ] #NEWLINE# for domain in Domain . objects . order_by ( '-id' ) [ : 50 ] : #NEWLINE# #INDENT# domain_search_latest = domain . domainsearch_set . all ( ) . last ( ) #NEWLINE# if ( not domain_search_latest ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# count = domain_search_latest . domainsearchresult_set . count ( ) #NEWLINE# domains_and_latest_counts . append ( ( domain . name , count ) ) #NEWLINE# #UNINDENT# context [ 'table_data' ] = domains_and_latest_counts #NEWLINE# return context