#NEWLINE# def job_search( request ) : #NEWLINE# #INDENT# ' A search view, does the job but not great. Job searches should be\n        handled by a proper search app, namely django-haystack.\n    ' #NEWLINE# query_string = '' #NEWLINE# found_entries = Job . objects . none ( ) #NEWLINE# extra_context = { #NEWLINE# #INDENT# 'keywords' : ' ' , #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( 'keywords' in request . POST ) and request . POST [ 'keywords' ] . strip ( ) ) : #NEWLINE# #INDENT# request . session [ 'keywords' ] = request . POST [ 'keywords' ] #NEWLINE# query_string = request . session [ 'keywords' ] #NEWLINE# extra_context [ 'keywords' ] = query_string #NEWLINE# search_fields = [ 'title' , 'description' , 'category' , 'jobtype' , 'city' , 'outside_location' , 'company' ] #NEWLINE# entry_query = get_query ( query_string , search_fields ) #NEWLINE# jobs_per_search = djobberbase_settings . DJOBBERBASE_JOBS_PER_SEARCH #NEWLINE# found_entries = Job . objects . filter ( entry_query ) . order_by ( '-created_on' ) [ : jobs_per_search ] #NEWLINE# search = JobSearch ( keywords = query_string ) #NEWLINE# search . save ( ) #NEWLINE# #UNINDENT# return object_list ( request , queryset = found_entries , extra_context = extra_context , paginate_by = djobberbase_settings . DJOBBERBASE_JOBS_PER_PAGE )