def count_queries(exec_string, setup_string):
 exec setup_string
 num_queries_old = len(connection.queries)
 exec exec_string
 nqueries = (len(connection.queries) - num_queries_old)
 for query in connection.queries[((- nqueries) if nqueries else 1):]:
  print(query['time'], query['sql'])
 print(('Number of queries: %s' % nqueries))

def count_queries ( exec_string , setup_string ) : exec setup_string num_queries_old = len ( connection . queries ) exec exec_string nqueries = ( len ( connection . queries ) - num_queries_old ) for query in connection . queries [ ( ( - nqueries ) if nqueries else 1 ) : ] : print ( query [ 'time' ] , query [ 'sql' ] ) print ( ( 'Number of queries: %s' % nqueries ) )
display queries done by exec_string .