parameters: (request, *args, **kwargs)
return_statement: return HttpResponse(json.dumps(data), "text/plain")
docstring: Returns data for jQuery UI autocomplete.
  
      @param request: Django Request.
docstring_summary: Returns data for jQuery UI autocomplete.
docstring_tokens: Returns data for jQuery UI autocomplete .
function: def view_books_autocomplete(request, *args, **kwargs):
      """
      Returns data for jQuery UI autocomplete.
  
      @param request: Django Request.
  
      """
  
      term = request.GET.get("term", "").lower()
      book = request.GET.get("book", "").lower()
  
      if not book:
          books = models.Book.objects.filter(hidden=False).order_by("title")
          data = [dict(label_no_use=book.title, value=book.url_title)
                  for book in books
                  if not term or (term in book.title.lower() or
                                  term in book.url_title)]
      else:
          chapters = models.Chapter.objects.filter(book__url_title=book)
          data = [dict(label_no_use=chapter.title, value=chapter.url_title)
                  for chapter in chapters
                  if not term or (term in chapter.title.lower() or
                                  term in chapter.url_title)]
  
      return HttpResponse(json.dumps(data), "text/plain")
function_tokens: def view_books_autocomplete ( request , * args , * * kwargs ) : term = request . GET . get ( "term" , "" ) . lower ( ) book = request . GET . get ( "book" , "" ) . lower ( ) if not book : books = models . Book . objects . filter ( hidden = False ) . order_by ( "title" ) data = [ dict ( label_no_use = book . title , value = book . url_title ) for book in books if not term or ( term in book . title . lower ( ) or term in book . url_title ) ] else : chapters = models . Chapter . objects . filter ( book__url_title = book ) data = [ dict ( label_no_use = chapter . title , value = chapter . url_title ) for chapter in chapters if not term or ( term in chapter . title . lower ( ) or term in chapter . url_title ) ] return HttpResponse ( json . dumps ( data ) , "text/plain" )