def __execute_many(cursor, array, col_names, **kwargs): linecount = len(array) if not linecount: return # Transpose the array into a hash with col_names as keys params = rhnLib.transpose_to_hash(array, col_names) for k, v in kwargs.items(): params[k] = [ v ] * linecount apply(cursor.executemany, (), params)
def __execute_many(cursor, array, col_names, **kwargs): """ Execute the cursor, with arguments extracted from the array The array is converted into a hash having col_names as keys, and adds whatever kwarg was specified too. """ linecount = len(array) if not linecount: return # Transpose the array into a hash with col_names as keys params = rhnLib.transpose_to_hash(array, col_names) for k, v in list(kwargs.items()): params[k] = [v] * linecount cursor.executemany(**params)
def __execute_many(cursor, array, col_names, **kwargs): """ Execute the cursor, with arguments extracted from the array The array is converted into a hash having col_names as keys, and adds whatever kwarg was specified too. """ linecount = len(array) if not linecount: return # Transpose the array into a hash with col_names as keys params = rhnLib.transpose_to_hash(array, col_names) for k, v in kwargs.items(): params[k] = [v] * linecount cursor.executemany(**params)