title: Django class based view with FormMixin and ListView
body: <p>I am having trouble connecting my Django view with my Django template.  I am trying to use a class based view with FormMixin and ListView.  </p>
  
  <pre><code>class Merchants(FormMixin, ListView):
      """
      A view of that shows a list of all the merchants.
      """
      template_name = "reporting/merchants.html"
      model = models.Merchant
      context_object_name = "merchants"
  
      def get_queryset(self):
          queryset = super(ViewClassName, self).get_queryset()
          search_query = self.request.GET.get("q", None)
          if search_query:
              queryset = queryset.filter(name__ilike=search_query)
              return queryset
  </code></pre>
  
  <p>My goal is to use my get_queryset function in my template to allow users to search for merchants.  This form is posting to itself but unfortunately it isn't returning anything. I've read Django documentation on FormMixins but still can't figure it out.  Any help would be must appreciated.</p>
  
  <pre><code>&lt;form action= ""&gt;
  &lt;input name="q" placeholder="search for merchant"&gt;
  &lt;button type="submit"&gt;Search &lt;/button&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>Thank you!</p>