#NEWLINE# def multi_raw( query , params , models , model_to_fields ) : #NEWLINE# #INDENT# 'Scoop multiple model instances out of the DB at once, given a query that\n    returns all fields of each.\n\n    Return an iterable of sequences of model instances parallel to the\n    ``models`` sequence of classes. For example::\n\n        [(<User such-and-such>, <Watch such-and-such>), ...]\n\n    ' #NEWLINE# cursor = connections [ router . db_for_read ( models [ 0 ] ) ] . cursor ( ) #NEWLINE# cursor . execute ( query , params ) #NEWLINE# rows = cursor . fetchall ( ) #NEWLINE# for row in rows : #NEWLINE# #INDENT# next_value = iter ( query ) . next #NEWLINE# ( yield [ model_class ( ** dict ( ( ( a , next_value ( ) ) for a in model_to_fields [ model_class ] ) ) ) for model_class in models ] )