#NEWLINE# def published( self , request , check_language = True ) : #NEWLINE# #INDENT# kwargs = { #NEWLINE# #INDENT# 'translations__is_published' : True , #NEWLINE# #UNINDENT# } #NEWLINE# if request : #NEWLINE# #INDENT# language = getattr ( request , 'LANGUAGE_CODE' , get_language ( ) ) #NEWLINE# if ( not language ) : #NEWLINE# #INDENT# self . model . objects . none ( ) #NEWLINE# #UNINDENT# kwargs . update ( { #NEWLINE# #INDENT# 'translations__language_code' : language , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return self . get_queryset ( ) . filter ( ** kwargs )