#NEWLINE# @ staticmethod #NEWLINE# def apply_boost( queryset , filters ) : #NEWLINE# #INDENT# if ( ( 'boost' in queryset ) and ( len ( filters [ 'boost' ] . split ( ',' ) ) == 2 ) ) : #NEWLINE# #INDENT# ( term , boost ) = iter ( filters [ 'boost' ] . split ( ',' ) ) #NEWLINE# try : #NEWLINE# #INDENT# queryset = queryset . boost ( term , float ( boost ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise ValueError ( 'Cannot convert boost to float value. Make sure to provide a numerical boost value.' ) #NEWLINE# #UNINDENT# #UNINDENT# return queryset