#NEWLINE# def _prepare( self , field ) : #NEWLINE# #INDENT# if ( self . _fields is not None ) : #NEWLINE# #INDENT# if ( len ( ( self . _fields or self . model . _meta . concrete_fields ) ) > 1 ) : #NEWLINE# #INDENT# raise TypeError ( 'Cannot use multi-field values as a filter value.' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . model != field . model ) : #NEWLINE# #INDENT# foreign_fields = getattr ( field , 'foreign_related_fields' , ( ) ) #NEWLINE# if ( ( len ( foreign_fields ) == 1 ) and ( not foreign_fields [ 0 ] . primary_key ) ) : #NEWLINE# #INDENT# return self . values ( foreign_fields [ 0 ] . name ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return field