#NEWLINE# def select_related( self , * fields , **kwargs ) : #NEWLINE# #INDENT# '\n        Returns a new QuerySet instance that will select related objects.\n\n        If fields are specified, they must be ForeignKey fields and only those\n        related objects are included in the selection.\n        ' #NEWLINE# depth = kwargs . pop ( 'depth' , 0 ) #NEWLINE# if kwargs : #NEWLINE# #INDENT# raise TypeError ( ( 'Unexpected keyword arguments to select_related: %s' % ( kwargs . keys ( ) , ) ) ) #NEWLINE# #UNINDENT# obj = self . _clone ( ) #NEWLINE# if fields : #NEWLINE# #INDENT# if depth : #NEWLINE# #INDENT# raise TypeError ( 'Cannot pass both "depth" and fields to select_related()' ) #NEWLINE# #UNINDENT# obj . query . add_select_related ( fields ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj . query . select_related = True #NEWLINE# #UNINDENT# if depth : #NEWLINE# #INDENT# obj . query . max_depth = depth #NEWLINE# #UNINDENT# return obj