#NEWLINE# def complete( self , field_name , query ) : #NEWLINE# #INDENT# '\n        Returns a list of close values for auto-completion\n        ' #NEWLINE# if ( field_name not in ( self . model . Elasticsearch . completion_fields or [ ] ) ) : #NEWLINE# #INDENT# raise ValueError ( '{0} is not in the completion_fields list, it is required to have a specific mapping.' . format ( field_name ) ) #NEWLINE# #UNINDENT# complete_name = '{0}_complete' . format ( field_name ) #NEWLINE# return self . queryset . complete ( complete_name , query )