#NEWLINE# def qs_and_collection( self , qs ) : #NEWLINE# #INDENT# 'Return (qs, collection) from qs (which may be a tuple).' #NEWLINE# if hasattr ( qs , 'model' ) : #NEWLINE# #INDENT# return ( qs , self . get_collection ( qs . model ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( qs , ( list , tuple ) ) : #NEWLINE# #INDENT# return ( qs [ 0 ] , self . get_col_by_name ( qs [ 1 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( ( 'Invalid query spec: %r' % qs ) )