title: Django - Mixing ListView and CreateView
body: <p>I'm want to create one page with a form, and every time I submit the form it adds an item to the list below the form.</p>
  
  <p>I can make it work using 2 pages:</p>
  
  <ul>
  <li>one page using the mixin <code>CreateView</code> to add items</li>
  <li>one page <code>ListView</code> to have the list.</li>
  </ul>
  
  <hr>
  
  <p>But I'm trying to have the form and the list on the same page. So I tried to create a class with both mixin:</p>
  
  <pre><code>class FormAndListView(ListView, CreateView):
      pass
  </code></pre>
  
  <p>Then I've used this class:</p>
  
  <pre><code>FormAndListView.as_view(
      queryset=PdfFile.objects.order_by('id'),
      context_object_name='all_PDF',
      success_url = 'listview',
      form_class = UploadFileForm,
      template_name='textfrompdf/index.html',)),
  </code></pre>
  
  <p>But when I try to load the page, I get the error: <code>Exception Value: 'FormAndListView' object has no attribute 'object'</code></p>
  
  <pre><code>Traceback:
  File "C:\Program Files\Python_2.7\lib\site-packages\django\core\handlers\base.py" in get_response
    111.                         response = callback(request, *callback_args, **callback_kwargs)
  File "C:\Program Files\Python_2.7\lib\site-packages\django\views\generic\base.py" in view
    47.             return self.dispatch(request, *args, **kwargs)
  File "C:\Program Files\Python_2.7\lib\site-packages\django\views\generic\base.py" in dispatch
    68.         return handler(request, *args, **kwargs)
  File "C:\Program Files\Python_2.7\lib\site-packages\django\views\generic\list.py" in get
    122.         return self.render_to_response(context)
  File "C:\Program Files\Python_2.7\lib\site-packages\django\views\generic\base.py" in render_to_response
    94.             template = self.get_template_names(),
  File "C:\Program Files\Python_2.7\lib\site-packages\django\views\generic\list.py" in get_template_names
    134.             names = super(MultipleObjectTemplateResponseMixin, self).get_template_names()
  File "C:\Program Files\Python_2.7\lib\site-packages\django\views\generic\detail.py" in get_template_names
    122.         if self.object and self.template_name_field:
  
  Exception Type: AttributeError at /PDF/
  Exception Value: 'FormAndListView' object has no attribute 'object'
  </code></pre>
  
  <p>I've no idea how to debug that. Where to start?</p>