title: How to display only the filter form?
body: <p>So I have set a filter for my model. Below works just fine. However, when I press filter (on home.html), it would fetch and display the whole database first below the filter form (please see screenshot). </p>
  
  <p><a href="https://i.stack.imgur.com/0sHut.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0sHut.png" alt="enter image description here"></a></p>
  
  <p>I don't want the program to pull all data from database in the first place. Instead I'd like it when I press filter from home.html, displays filter form only then wait for user input and show the result below the form.  </p>
  
  <p>views.py:</p>
  
  <pre><code>def search(request):
      option = option2019.objects.get_queryset()
      option_filter = optionFilter(request.GET, queryset=option)
      return render(request, 'option.html', {'filter':option_filter})
  </code></pre>
  
  <p>url.py</p>
  
  <pre><code>urlpatterns = [
  path('simple_upload', views.simple_upload, name='simple_upload'),
  path('search/', FilterView.as_view(filterset_class=optionFilter, template_name='option.html'), name='search'),
  path('OptionUpdate/&lt;int:id&gt;', views.OptionUpdate.as_view(), name='OptionUpdate'),]
  </code></pre>
  
  <p>option.html:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{% extends 'base.html' %}
  
  {% load widget_tweaks %}
  
  
  {% block content %}
  {% if user.is_authenticated %}
  &lt;form method="get"&gt;
      &lt;div class="well container"&gt;
          &lt;h4 style="margin-top: 0"&gt;Filter&lt;/h4&gt;
  
          {{ filter.form.as_p }}
  
          &lt;button type="submit" class="btn btn-primary"&gt; Search &lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  
  
  
  &lt;div style="margin: 20px;"&gt;
      &lt;h3&gt;Demographics:&lt;/h3&gt;
      &lt;table class="table table-bordered"&gt;
          &lt;thead class="thead-dark"&gt;
              &lt;tr&gt;
                  &lt;th&gt;Last Name&lt;/th&gt;
                  &lt;th&gt;First Name&lt;/th&gt;
                  &lt;th&gt;DOB&lt;/th&gt;
                  &lt;th&gt;SSN&lt;/th&gt;
                  &lt;th&gt;Home Phone&lt;/th&gt;
                  &lt;th&gt;Phone1&lt;/th&gt;
                  &lt;th&gt;Phone2&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
  
          &lt;tbody&gt;
              {% for hha in filter.qs %}
              &lt;tr&gt;
                  &lt;td&gt;{{ hha.LastName }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.FirstName }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.dob }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.SSN }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.HomePhone}}&lt;/td&gt;
                  &lt;td&gt;{{ hha.Phone1}}&lt;/td&gt;
                  &lt;td&gt;{{ hha.Phone2}}&lt;/td&gt;
              &lt;/tr&gt;
              {% endfor %}
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  
  
  &lt;div style="margin: 20px;"&gt;
      &lt;h3&gt;Records:&lt;/h3&gt;
      &lt;table class="table table-bordered"&gt;
          &lt;thead class="thead-dark"&gt;
              &lt;tr&gt;
  
                  &lt;th&gt;Option&lt;/th&gt;
                  &lt;th&gt;Medical Option&lt;/th&gt;
                  &lt;th&gt;WP Default&lt;/th&gt;
                  &lt;th&gt;TRN&lt;/th&gt;
                  &lt;th&gt;PKG&lt;/th&gt;
                  &lt;th&gt;CELL&lt;/th&gt;
                  &lt;th&gt;DCA&lt;/th&gt;
                  &lt;th&gt;HRP&lt;/th&gt;
                  &lt;th&gt;Remarks&lt;/th&gt;
                  &lt;th&gt;Option Changed&lt;/th&gt;
                  &lt;th&gt;Updated PP&lt;/th&gt;
                  &lt;th&gt;Updated By&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
  
          &lt;tbody&gt;
              {% for hha in filter.qs %}
              &lt;tr&gt;
  
                  &lt;td style="background-color: #82b74b"&gt;{{ hha.option }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.medical }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.WPDefault }}&lt;/td&gt;
                  &lt;td style="background-color:#b7d7e8"&gt;${{ hha.trn }}&lt;/td&gt;
                  &lt;td style="background-color:#b7d7e8"&gt;${{ hha.pkg }}&lt;/td&gt;
                  &lt;td style="background-color:#b7d7e8"&gt;${{ hha.cell }}&lt;/td&gt;
                  &lt;td style="background-color:#b7d7e8"&gt;${{ hha.dca }}&lt;/td&gt;
                  &lt;td style="background-color:#b7d7e8"&gt;${{ hha.hrp }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.Remarks }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.OptionChanged }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.updated }}&lt;/td&gt;
                  &lt;td&gt;{{ hha.updatedBy }}&lt;/td&gt;
                  &lt;td&gt;
                      &lt;a href="{% url 'HHA_2019_Records:OptionUpdate' hha.id %}"&gt;&lt;span&gt;Edit&lt;/span&gt;&lt;/a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              {% endfor %}
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  
  {% else %}
  {% endif %}
  {% endblock %}</code></pre>
  </div>
  </div>
  </p>
  
  <p>Appreciate for any kind of help!!</p>