parameters: (request)
return_statement: return render_to_response(
          get_desktop_or_mobile_template(request, "blog", "post_list.html"),
          {
              "page_obj": returned_page,
              "object_list": returned_page.object_list,
              "search": query,
          },
      )
docstring: Search for a post by title or abstract. To search http://example.com/search?q=title
  
      Args:
          request (obj): Request object
docstring_summary: Search for a post by title or abstract. To search http://example.com/search?q=title
docstring_tokens: Search for a post by title or abstract . To search http : // example . com / search?q = title
function: def get_search_results(request):
      """Search for a post by title or abstract. To search http://example.com/search?q=title
  
      Args:
          request (obj): Request object
  
      """
      # Get the query data
      query = request.GET.get("q", "")
      page = request.GET.get("page", 1)
  
      # Query the database
      results = Post.objects.filter(
          Q(title__icontains=query) | Q(abstract__icontains=query)
      )
  
      # Add pagination
      pages = Paginator(results, 5)
  
      # Get specified page
      try:
          returned_page = pages.page(page)
      except EmptyPage:
          returned_page = pages.page(pages.num_pages)
  
      # Display the search results
      return render_to_response(
          get_desktop_or_mobile_template(request, "blog", "post_list.html"),
          {
              "page_obj": returned_page,
              "object_list": returned_page.object_list,
              "search": query,
          },
      )
function_tokens: def get_search_results ( request ) : # Get the query data query = request . GET . get ( "q" , "" ) page = request . GET . get ( "page" , 1 ) # Query the database results = Post . objects . filter ( Q ( title__icontains = query ) | Q ( abstract__icontains = query ) ) # Add pagination pages = Paginator ( results , 5 ) # Get specified page try : returned_page = pages . page ( page ) except EmptyPage : returned_page = pages . page ( pages . num_pages ) # Display the search results return render_to_response ( get_desktop_or_mobile_template ( request , "blog" , "post_list.html" ) , { "page_obj" : returned_page , "object_list" : returned_page . object_list , "search" : query , } , )