title: Setting up a search function in my Django app
body: <p>Quick question:</p>
  
  <p>I made a search bar in my Django app.
  It works if I type in first or last name.  But when I try AND &amp; it doesn't work.  Here's what I have:</p>
  
  <pre><code>    def names(request):
        all_names = name.objects.all
        search_term = ""
        if 'search' in request.GET:
        search_term = request.GET['search']
        all_name = name.objects.filter(
            Q(first__startswith=search_term) |
            Q(last__startswith=search_term)
  
        return render(request, "about.html", {'all_names': all_names, 'search_term': search_term})
  </code></pre>
  
  <p>This works as far as OR is concerned but when I slide the &amp; in place of the | it looses functionality.  I'm stumped.  According to the Django docs, &amp; should automatically include both.  I just want to be able to type in both first and last name in the search bar.</p>