#NEWLINE# def get( self ) : #NEWLINE# #INDENT# 'Handles GET requests.' #NEWLINE# query_string = self . request . get ( 'q' ) #NEWLINE# search_cursor = self . request . get ( 'cursor' , None ) #NEWLINE# ( exp_ids , search_cursor ) = exp_services . get_exploration_ids_matching_query ( query_string , cursor = search_cursor ) #NEWLINE# explorations_list = summary_services . get_displayable_exp_summary_dicts_matching_ids ( preferred_language_codes ) #NEWLINE# if ( len ( explorations_list ) == feconf . DEFAULT_QUERY_LIMIT ) : #NEWLINE# #INDENT# logging . error ( ( '%s explorations were fetched to load the gallery page. You may be running up against the default query limits.' % feconf . DEFAULT_QUERY_LIMIT ) ) #NEWLINE# #UNINDENT# preferred_language_codes = [ feconf . DEFAULT_LANGUAGE_CODE ] #NEWLINE# if self . user_id : #NEWLINE# #INDENT# user_settings = user_services . get_user_settings ( self . user_id ) #NEWLINE# preferred_language_codes = user_settings . preferred_language_codes #NEWLINE# #UNINDENT# self . values . update ( { #NEWLINE# #INDENT# 'explorations_list' : explorations_list , #NEWLINE# 'preferred_language_codes' : preferred_language_codes , #NEWLINE# 'search_cursor' : search_cursor , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . render_json ( self . values )