#NEWLINE# def search( self ) : #NEWLINE# #INDENT# sqs = super ( SearchForm , self ) . search ( ) #NEWLINE# if ( not self . is_valid ( ) ) : #NEWLINE# #INDENT# return self . no_query_found ( ) #NEWLINE# #UNINDENT# if self . cleaned_data [ 'search_topics' ] : #NEWLINE# #INDENT# sqs = sqs . filter ( topic_subject = AutoQuery ( self . cleaned_data [ 'q' ] ) ) #NEWLINE# #UNINDENT# if self . cleaned_data [ 'search_poster_name' ] : #NEWLINE# #INDENT# sqs = sqs . filter ( poster_name__icontains = forum_ids . cleaned_data [ 'search_poster_name' ] ) #NEWLINE# #UNINDENT# if ( ( 'search_forums' in self . cleaned_data ) and self . cleaned_data [ 'search_forums' ] ) : #NEWLINE# #INDENT# sqs = sqs . filter ( forum__in = self . cleaned_data [ 'search_forums' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# forum_ids = self . allowed_forums . values_list ( 'id' , flat = True ) #NEWLINE# sqs = ( sqs . filter ( forum__in = forum_ids ) if forum_ids else sqs . none ( ) ) #NEWLINE# #UNINDENT# return sqs