title: Retrieving information form several textbox (Template) in Django
body: <p>**I want to fetch information from course titile &amp; course code textbox ,,,, if title &amp; code both are given or only title /code data will be showed.
  Bt, in my code not working when only title are given..
  what are the logical mistake..?? My View Code </p>
  
  <pre><code>def search_view(request):
  c = 0
  d = 0
  c_title = ''
  c_code = ''
  course_Details = ''
  course_Details1 = ''
  if request.GET.get('Code'):
      c_code = request.GET.get("Code")
  if request.GET.get('Course_Title'):
      c_title = request.GET.get("Course_Title")
  if c_code != '':
      course_Details = Course.objects.filter(course_code=c_code)
      if (course_Details):
          c = 1
  if c_title != '':
      if c == 1:
          course_Details1 = course_Details.filter(course_title=c_title)
          if (course_Details1):
              d = 1
      if d == 1:
          course_Details = course_Details1
  
      if d == 0:
          course_Details = Course.objects.filter(course_title=c_title)
  if c == 1 | d == 1:
      return render(request, 'index.html', {'course_Details': course_Details})
  else:
      return render(request, 'index.html')
  </code></pre>