#NEWLINE# def build_lookup( self , lookups , lhs , rhs ) : #NEWLINE# #INDENT# '\n        Tries to extract transforms and lookup from given lhs.\n\n        The lhs value is something that works like SQLExpression.\n        The rhs value is what the lookup is going to compare against.\n        The lookups is a list of names to extract using get_lookup()\n        and get_transform().\n        ' #NEWLINE# lookups = lookups [ : ] #NEWLINE# while lookups : #NEWLINE# #INDENT# name = lookups [ 0 ] #NEWLINE# if ( len ( final_lookup ) == 1 ) : #NEWLINE# #INDENT# final_lookup = lhs . get_lookup ( name ) #NEWLINE# if ( not final_lookup ) : #NEWLINE# #INDENT# lhs = self . try_transform ( lhs , name , lookups ) #NEWLINE# final_lookup = lhs . get_lookup ( 'exact' ) #NEWLINE# #UNINDENT# return final_lookup ( lhs , rhs ) #NEWLINE# #UNINDENT# lhs = self . try_transform ( lhs , name , lookups ) #NEWLINE# lookups = lookups [ 1 : ]