@coroutine
def QueryPrinter():
    connection.queries = []
    settings.DEBUG = True
    offset = 0
    
    while True:
        diff = len(connection.queries) - offset
        
        if diff:
            print diff, "QUERIES AT OFFSET", offset
            print "Time/s | SQL"
            
            for query in connection.queries[offset:]:
                print "%06.3f | '%s'" % (float(query['time']), query['sql'])
        offset = (yield)
Initialize a query printer coroutine.
dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/docutil/test_util.py/QueryPrinter