def connect ( * args , * * kwargs ) : kwargs [ 'cursor_factory' ] = TraceCursor conn = pg_connect ( * args , * * kwargs ) return conn
python creating cursor connection to stored procedure as opposed to tables
Create database connection use TraceCursor as the cursor_factory .
def connect(*args, **kwargs):
    """Create database connection, use TraceCursor as the cursor_factory."""
    kwargs['cursor_factory'] = TraceCursor
    conn = pg_connect(*args, **kwargs)
    return conn