#NEWLINE# def get_product_from_options( self , options ) : #NEWLINE# #INDENT# '\n        Accepts an iterable of either Option object or a sorted tuple of\n        options ids.\n        Returns the product that matches or None\n        ' #NEWLINE# options = self . _unique_ids_from_options ( options ) #NEWLINE# pv = None #NEWLINE# if hasattr ( options , '_variation_cache' ) : #NEWLINE# #INDENT# pv = self . _variation_cache . get ( options , None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for member in self . productvariation_set . all ( ) : #NEWLINE# #INDENT# if ( member . unique_option_ids == options ) : #NEWLINE# #INDENT# pv = member #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if pv : #NEWLINE# #INDENT# return pv . product #NEWLINE# #UNINDENT# return None