#NEWLINE# def get_stats( self ) : #NEWLINE# #INDENT# '\n        Generates the stats for current division\n        ' #NEWLINE# total_matches_played = 0.0 #NEWLINE# total_matches = ( ( self . league_set . count ( ) * ( self . league_set . count ( ) - 1 ) ) / 2 ) #NEWLINE# total_matches_played += ( self . result_set . count ( ) / 2 ) #NEWLINE# perc_matches_played = ( ( total_matches_played / total_matches ) * 100 ) #NEWLINE# return { #NEWLINE# #INDENT# 'total_matches_played' : int ( total_matches_played ) , #NEWLINE# 'total_matches' : int ( total_matches ) , #NEWLINE# 'perc_matches_played' : perc_matches_played , #NEWLINE# #UNINDENT# }