#NEWLINE# def get_queryset( self ) : #NEWLINE# #INDENT# queryset = super ( GetImagesView , self ) . get_queryset ( ) . order_by ( '-id' ) #NEWLINE# query = Q ( ) #NEWLINE# q = self . request . GET . get ( 'q' ) #NEWLINE# user = ( self . request . GET . get ( 'user' ) or 0 ) #NEWLINE# published = self . request . GET . get ( 'published' , 1 ) #NEWLINE# if q : #NEWLINE# #INDENT# query &= ( Q ( title__icontains = q ) | Q ( description__icontains = q ) ) #NEWLINE# #UNINDENT# if user : #NEWLINE# #INDENT# query &= Q ( user__id = user ) #NEWLINE# #UNINDENT# if published : #NEWLINE# #INDENT# query &= Q ( published = int ( published ) ) #NEWLINE# #UNINDENT# queryset = queryset . filter ( query ) #NEWLINE# return queryset . _clone ( )