title: Django Pagination returns entire database on page 2
body: <p>Trying to get pagination to work in <code>Django</code>. It looks fine on page 1 but when I go to page 2, I can see my entire database is shown.</p>
  
  <p><strong>This is my code:</strong></p>
  
  <pre><code>class AdvancedSearch(ListView):
          template_name= 'saferdb/AdvancedQuery.html'
  
          def get(self, request):
              c = request.GET.getlist('opeclass')
              q = Question.objects.all()
  
              #Ugly q filtering methods
  
              paginator = Paginator(q, 25)
              page = request.GET.get('page')
              contacts = paginator.get_page(page)
              return render(request, 'saferdb/list.html', {'text' : count , 'contacts': contacts})
  </code></pre>
  
  <p>URLS.py</p>
  
  <pre><code>urlpatterns = [
      url(r'^$', views.index, name='index'),
      url(r'^query/$', views.QueryView.as_view(), name='query'),
      url(r'^advanced/$', views.AdvancedSearch.as_view(), name='advanced'),
  ]
  </code></pre>
  
  <p>template code:</p>
  
  <pre><code>&lt;form method="get"&gt;
  
  &lt;!--- bunch of selection to filer output by ---&gt;
  &lt;div class="pagination"&gt;
      &lt;span class="step-links"&gt;
          {% if contacts.has_previous %}
              &lt;a href="?page=1"&gt;&amp;laquo; first&lt;/a&gt;
              &lt;a href="?page={{ contacts.previous_page_number }}"&gt;previous&lt;/a&gt;
          {% endif %}
  
          &lt;span class="current"&gt;
              Page {{ contacts.number }} of {{ contacts.paginator.num_pages }}.
          &lt;/span&gt;
  
          {% if contacts.has_next %}
              &lt;a href="?page={{ contacts.next_page_number }}"&gt;next&lt;/a&gt;
              &lt;a href="?page={{ contacts.paginator.num_pages }}"&gt;last &amp;raquo;&lt;/a&gt;
          {% endif %}
      &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>